ADBMS Lab Manual
ADBMS Lab Manual
1
Title of Assignment:
Implement a system using multivalued Attributes and
Inheritance in ORDBMS.
Advantages of Objects
Object-Relational Elements
Object Types
Type Inheritance
Objects
Object Tables
Varrays
Nested Tables
A nested table is an unordered set of data elements, all of the
same datatype. It has a single column, and the type of that
column is a built-in type or an object type. If the column
in a nested table is an object type, the table can also be
viewed as a multi-column table, with a column for each
attribute of the object type.
Conclusion:
Multivalued attributes and inheritance in ORDBMS is
implemented.
Assignment No.2
Title of Assignment:
Implement K-Means Data Mining Clustering Algorithm.
and
8. Iteration-2, Objects-Centroids distances : Repeat step 2
again, we have new distance matrix at iteration 2 as
Conclusion:
Thus grouped all the user data (X,Y)into three clusters by
minimizing the sum of squares of distances between data and
the corresponding cluster centroid.
Assignment No.3
Title of Assignment:
Design a Web-based application using ASP involving
Database.
Relevant Theory / Literature Survey:
The need for ASP
Why bother with ASP at all, when HTML can serve your needs?
If you want to display information, all you have to do is
fire up your favorite text editor, type in a few HTML tags,
and save it as an HTML file.
But wait – what if you want to display information that
changes? Supposing you’re writing a page that provides
constantly changing information to your visitors, for
example, weather reports, stock quotes, a list of your
girlfriends, etc, HTML can no longer keep up with the pace.
What you need is a system that can present dynamic
information. And ASP fits the bill perfectly.
Implementation:
Database Connectivity
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (“ADODB.Connection”)
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
“C:\Databases\Students.mdb”)
Dim RS
Set RS = Server.CreateObject (“ADODB.Recordset”)
RS.Open “SELECT * FROM Students”, DB
%>
</BODY>
</HTML>
The first few lines are the opening HTML tags for any page.
There’s no ASP code within them. The ASP block begins with
the statement,
Dim DB
The string,
"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
“C:\Databases\Students.mdb”
Dim RS
Set RS = Server.CreateObject (“ADODB.Recordset”)
RS.Open “Students”, DB, adOpenStatic, adLockPessimistic
RS.AddNew
RS (“FirstName”) = “Kavitha”
RS (“LastName”) = “Nair”
RS (“Email”) = “kavitha@kavithanair.com”
RS (“DateOfBirth”) = CDate(“4 Feb, 1980”)
RS.Update
%>
</BODY>
</HTML>
Updating Records
<HTML>
<HEAD>
<TITLE>Student Records</TITLE>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (“ADODB.Connection”)
DB.Mode = adModeReadWrite
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
“C:\Databases\Students.mdb”)
Dim RS
Set RS = Server.CreateObject (“ADODB.Recordset”)
RS.Open “SELECT * FROM Students WHERE FirstName =
‘Kavitha’”, DB, adOpenStatic, adLockPessimistic
RS (“Email”) = “mynewemail@kavithanair.com”
RS (“DateOfBirth”) = CDate(“4 Feb, 1980”)
RS.Update
%>
</BODY>
</HTML>
Deleting Records
<HTML>
<HEAD>
<TITLE>Student Records</TITLE>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (“ADODB.Connection”)
DB.Mode = adModeReadWrite
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
“C:\Databases\Students.mdb”)
%>
</BODY>
</HTML>
Retrieving Data
<HTML>
<HEAD>
<TITLE>Student Records</TITLE>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (“ADODB.Connection”)
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
“C:\Databases\Students.mdb”)
Dim RS
Set RS = Server.CreateObject (“ADODB.Recordset”)
RS.Open “SELECT * FROM Students”, DB
Conclusion:
A web based application for student registration is
implemented with ASP. The application also performs adding
new student, deleting a student and modifying a students
record .
Assignment No.4
Title of Assignment:
To create a simple multi-dimensional cube.
Relevant Theory / Literature Survey:
Installation of Analysis Services Of MSSQL 2000 is the
primary requirement. When we installed MSSQL 2000 Analysis
Services, Analysis Manager was also installed as a tool .
What is a Cube?
Star Schema
The star schema is the simplest data warehouse schema. It is
called a star schema because the diagram resembles a star,
with points radiating from a center. The center of the star
consists of one or more fact tables and the points of the
star are the dimension tables.
Hierarchies
Hierarchies are logical structures that use ordered levels
as a means of organizing data. A hierarchy can be used to
define data aggregation.
Testing:
(Input/ Output):
Conclusion:
A simple multi-dimensional cube is created and studied
Assignment No.5
Title of Assignment:
Study OF LDAP (Light weight Directory Access Protocol)
X500
LDAP
Data Types
Given all this, what's the full DN of the LDAP record for
this oatmeal recipe? Remember, it reads backwards - just
like a host name in DNS.
cn=Oatmeal Deluxe,ou=recipes,dc=foobar,dc=com
uid=fsmith,ou=employees,dc=foobar,dc=com
(login-based)
LDAP (and X.500) use uid to mean "User ID", not to be
confused with the UNIX uid number. Most companies try to
give everyone a unique login name, so this approach makes
good sense for storing information about employees. You
don't have to worry about what you'll do when you hire the
next Fran Smith, and if Fran changes her name (marriage?
divorce? religious experience?), you won't have to change
the DN of the LDAP entry.
cn=FranSmith,ou=employees,dc=foobar,dc=com
(name-based)
Here we see the Common Name (CN) entry used. In the case of
an LDAP record for a person, think of the common name as
their full name. One can easily see the downside to this
approach: if the name changes, the LDAP record has to "move"
from one DN to another. As indicated above, you want to
avoid changing the DN of an entry whenever possible.
uid: fsmith
givenname: Fran
sn: Smith
cn: Fran Smith
cn: Frances Smith
telephonenumber: 510-555-1234
roomnumber: 122G
o: Foobar, Inc.
mailRoutingAddress: fsmith@foobar.com
mailhost: mail.foobar.com
userpassword: {crypt}3x1231v76T89N
uidnumber: 1234
gidnumber: 1200
gecos: Frances Smith
homedirectory: /home/fsmith
loginshell: /usr/local/bin/bash
Conclusion:
Thus, the Light weight Directory Access Protocol is
studied.
Assignment No 6 (a)
Server Components
The server components of SQL Server 2000 are normally
implemented as 32-bit Windows services. The SQL Server and
SQL Server Agent services may also be run as standalone
applications on any supported Windows operating system
platform.
Table lists the server components and briefly describes
their function. It also specifies how the component is
implemented when multiple instances are used.
Table: Server Components and Their Functions
Server
Description
Component
MSSQLServer service implements the SQL Server
SQL Server
2000 database engine. There is one service
service
for each instance of SQL Server 2000.
Microsoft SQL
MSSQLServerOLAPService implements SQL Server
Server 2000
2000 Analysis Services. There is only one
Analysis
service, regardless of the number of
Services
instances of SQL Server 2000.
service
SQLServerAgent service implements the agent
SQL Server that runs scheduled SQL Server 2000
Agent service administrative tasks. There is one service
for each instance of SQL Server 2000.
Microsoft Search implements the full-text
Microsoft search engine. There is only one service,
Search service regardless of the number of instances of SQL
Server 2000.
Distributed Transaction Coordinator manages
distributed transactions between instances of
Microsoft (MS
SQL Server 2000. There is only one service,
DTC) service
regardless of the number of instances of SQL
Server 2000.
Logins, users, roles, and groups are the foundation for the
security mechanisms of SQL Server. Users who connect to SQL
Server must identify themselves by using a Specific Login
Identifier (ID). Users can then see only the tables and
views that they are authorized to see and can execute only
the stored procedures and administrative functions that
they are authorized to execute. This system of security is
based on the IDs used to identify users.
Allocating Space for Tables and Indexes
Before SQL Server 2000 can store information in a table or
an index, free space must be allocated from within a data
file and assigned to that object. Free space is allocated
for tables and indexes in units called extents. An extent
is 64 KB of space, consisting of eight contiguous pages,
each 8 KB in size. There are two types of extents, mixed
extents and uniform extents. SQL Server 2000 uses mixed
extents to store small amounts of data for up to eight
objects within a single extent and uses uniform extents to
store, whereas SQL Server 2000 uses uniform extents to
store data from a single object.
When a new table or index is created, SQL Server 2000
locates a mixed extent with a free page and allocates the
free page to the newly created object. A page contains data
for only one object. When an object requires additional
space, SQL Server 2000 allocates free space from mixed
extents until an object uses a total of eight pages.
Thereafter, SQL Server 2000 allocates a uniform extent to
that object. SQL Server 2000 will grow the data files in a
round-robin algorithm if no free space exists in any data
file and autogrow is enabled.
When SQL Server 2000 needs a mixed extent with at least one
free page, a Secondary Global Allocation Map (SGAM) page is
used to locate such an extent. Each SGAM page is a bitmap
covering 64,000 extents (approximately 4 GB) that is used
to identify allocated mixed extents with at least one free
page. Each extent in the interval that SGAM covers is
assigned a bit. The extent is identified as a mixed extent
with free pages when the bit is set to 1. When the bit is
set to 0, the extent is either a mixed extent with no free
pages, or the extent is a uniform extent.
When SQL Server 2000 needs to allocate an extent from free
space, a Global Allocation Map (GAM) page is used to locate
an extent that has not previously been allocated to an
object. Each GAM page is a bitmap that covers 64,000
extents, and each extent in the interval it covers is
assigned a bit. When the bit is set to 1, the extent is
free. When the bit is set to 0, the extent has already been
allocated.
THEORY:
History
Overview of MySQL AB
The “AB” part of the company name is the acronym for the
Swedish “aktiebolag,” or “stock company.” It translates to
“MySQL, Inc.”
Data Types:
• Many data types: signed/unsigned integers 1, 2, 3, 4, and
8 bytes long, FLOAT, DOUBLE, CHAR, VARCHAR, TEXT, BLOB,
DATE, TIME, DATETIME, TIMESTAMP, YEAR, SET, ENUM, and
OpenGIS spatial types.
• Fixed-length and variable-length records.
Security:
• A privilege and password system that is very flexible and
secure, and that allows host-based verification. Passwords
are secure because all password traffic is encrypted when
you connect to a server.
Connectivity:
• Clients can connect to the MySQL server using TCP/IP
sockets on any platform. On Windows systems in the NT
family (NT, 2000, XP, 2003, or Vista), clients can connect
using named pipes. On Unix systems, clients can connect
using Unix domain socket files.
• In MySQL 4.1 and higher, Windows servers also support
shared-memory connections if started with the --shared-
memory option. Clients can connect through shared memory by
using the --protocol=memory option.
• The Connector/ODBC (MyODBC) interface provides MySQL
support for client programs that use ODBC (Open Database
Connectivity) connections. For example, you can use MS
Access to connect to your MySQL server. Clients can be run
on Windows or Unix. MyODBC source is available. All ODBC
2.5 functions are supported, as are many others.
• The Connector/J interface provides MySQL support for Java
client programs that use JDBC connections. Clients can be
run on Windows or Unix. Connector/J source is available.
• MySQL Connector/NET enables developers to easily
create .NET applications that require secure, high-
performance data connectivity with MySQL. It implements the
required ADO.NET interfaces and integrates into ADO.NET
aware tools. Developers can build applications using their
choice of .NET languages. MySQL Connector/NET is a fully
managed ADO.NET driver written in 100% pure C#.
Localization:
• The server can provide error messages to clients in many
languages. See Section 5.11.2, “Setting the Error Message
Language”.
• Full support for several different character sets,
including latin1 (cp1252), german, big5, ujis, and more.
For example, the Scandinavian characters ‘å’, ‘ä’ and ‘ö’
are allowed in table and column names. Unicode support is
available as of MySQL 4.1.
• All data is saved in the chosen character set. All
comparisons for normal string columns are case-insensitive.
• Sorting is done according to the chosen character set
(using Swedish collation by default). It is possible to
change this when the MySQL server is started. To see an
example of very advanced sorting, look at the Czech sorting
code. MySQL Server supports many different character sets
that can be specified at compile time and runtime.
Transaction Management
Transaction Overview
Transaction - A sequence of executions of SQL
statements that can be treated as a single unit in which
all data changes can be committed or cancelled as a whole.
Most database servers offer two transaction management
modes:
• Auto Commit On: Each SQL statement is a transaction.
Data changes resulted from each statement are
automatically committed.
• Auto Commit Off: Transactions are explicitly started
and ended by the client program. Data changes are not
committed unless requested by the client program.
Most database server supports the following statements
for transaction management:
• Commit Statement - To commit all changes in the
current transaction.
• Rollback Statement - To rollback all changes in the
current transaction.
• Start Transaction Statement - To start a new
transaction.
SET AUTOCOMMIT = 0 | 1;
START TRANSACTOIN;
COMMIT;
ROLLBACK;
Note that:
Starting a Transaction
Implementing ROLLBACK
Implementing COMMIT
Storage
Query Processing
Applications
• Billing Management
• Compliance & Risk Management
• Customer Relationship Management (CRM)
• Demand Chain Management (DRM)
• Education
• Enterprise Content Management (ECM)
• Enterprise Information Portal (EIP)
• Enterprise Resources Planning (ERP)
• Financials
• Government
• Healthcare
• Human Resources Management (HRMS)
• Inventory Management
• Manufacturing
• Messaging & Collaboration
• Order Management
• Payroll Management
• Point of Sale (POS)
• Project Management
• Purchasing Management
• Retail
• Supply Chain Management (SCM)
MySQL Usage