Once the design of the database is completed and a DBMS is chosen to implement the database, the next step is to define the conceptual and internal schema for the data and any mappings between the two. The languages that are used to do so are :
• Data Definition Language (DDL): To specify the conceptual schema of a database by the DBA and by database designers. In many DBMSs, the DDL is also used to define internal and external schemas (views).
• In some DBMSs, separate storage definition language (SDL) are used to define internal and external schemas.
The mappings between the two schemas may be specified in either one of these languages. For a true three-schema architecture, a third language is needed, the view definition language (VDL), to specify user views and their mappings to conceptual schema.
Once the database schemas are compiled and the database is populated with data, users must have some means to manipulate the data.
• Data Manipulation Language (DML): Used to specify database retrievals and updates.
• DML commands (data sublanguage) can be embedded in a general-purpose programming language (hostlanguage), such as COBOL, C or an Assembly Language.
• Alternatively, stand-alone DML commands can be applied directly (query language).
DMLs can be high level(set-oriented, nonprocedural) or low level)record-oriented, procedural). A high-level DML can be embedded in a host programming language, or it can be used as a stand-alone language; in the latter case it is often called as a query language.
In current DBMSs, a comprehensive integrated language is used that includes constructs for conceptual schema definition, view definition, and data manipulation. A typical example of a comprehensive database language is the SQL relational database language.
Whenever DML commands are embedded in a general-purpose programming language, that language is called the host language and the DML is called the data sublanguage.
Tuesday, August 4, 2009
Database (DBMS) Languages
Posted by
Sunflower
at
8/04/2009 09:21:00 AM
0
comments
Labels: data definition language, data manipulation language, DBMS, DBMS languages, DDL, DML
|
| Subscribe by Email |
|
DBMS Three-Schema Architecture and Data Independence
WHAT IS DBMS ?
- To be able to carry out operations like insertion, deletion and retrieval, the database needs to be managed by a substantial piece of software; this software is usually called a Database Management System(DBMS).
- A DBMS is usually a very large software package that enables many different tasks including the provision of facilities to enable the user to access and modify information in the database.
- Data Description Languages (DDL) and Data Manipulation Languages (DML) are needed for manipulating and retrieving data stored in the DBMS. These languages are called respectively.
An architecture for database systems, called the three-schema architecture was proposed to help achieve and visualize the important characteristics of the database approach.
THE THREE-SCHEMA ARCHITECTURE:
The goal of the three-schema architecture is to separate the user applications and the physical database. In this architecture, schemas can be defined at 3 levels :
1. Internal level or Internal schema : Describes the physical storage structure of the database. The internal schema uses a physical data model and describes the complete details of data storage and access paths for the database.
2. Conceptual level or Conceptual schema : Describes the structure of the whole database for a community of users. It hides the details of physical storage structures and concentrates on describing entities, data types, relationships, user operations, and constraints. Implementation data model can be used at this level.
3. External level or External schema : It includes a number of external schemas or user views. Each external schema describes the part of the database that a particular user is interested in and hides the rest of the database from user. Implementation data model can be used at this level.
IMPORTANT TO REMEMBER :
Data and meta-data
- three schemas are only meta-data(descriptions of data).
- data actually exists only at the physical level.
Mapping
- DBMS must transform a request specified on an external schema into a request against the conceptual schema, and then into the internal schema.
- requires information in meta-data on how to accomplish the mapping among various levels.
- overhead(time-consuming) leading to inefficiencies.
- few DBMSs have implemented the full three-schema architecture.
DATA INDEPENDENCE
The disjointing of data descriptions from the application programs (or user-interfaces) that uses the data is called data independence. Data independence is one of the main advantages of DBMS. The three-schema architecture provides the concept of data independence, which means that upper-levels are unaffected by changes to lower-levels. The three schemas architecture makes it easier to achieve true data independence. There are two kinds of data independence.
- Physical data independence
* The ability to modify the physical scheme without causing application programs to be rewritten.
* Modifications at this level are usually to improve performance.
- Logical data independence
* The ability to modify the conceptual scheme without causing application programs to be rewritten.
* Usually done when logical structure of database is altered.
Logical data independence is harder to achieve as the application programs are usually heavily dependent on the logical structure of the data. An analogy is made to abstract data types in programming languages.
Posted by
Sunflower
at
8/04/2009 08:37:00 AM
0
comments
Labels: Architecture, Conceptual schema, Data independence, Database Management system, Databases, DBMS, External schema, Internal, Logical, Physical, three-schema architecture
|
| Subscribe by Email |
|
Monday, August 3, 2009
Database System Concepts - Data Model, Schemas and Database state
A data model is a collection of concepts that can be used to describe the structure of a database. By structure of the database we mean the data types, relationships, and constraints that should hold on the data. Most data models also include a set of basic operations for specifying retrievals and updates on database.
Categories of Data Models:
- High level or Conceptual data models : These models provide concepts that are close to the way many users perceive data. They use concepts such as entities, attributes, and relationships. An entity represents a real-world object or concept such as an employee or a project. An attribute represents property of interest that describes an entity such as employee's salary or name. A relationship represents an interaction among the entities.
- Representational data models : These models provides concept that may be understood by end users but that are not too far removed from the way data is organized within the computer. They are used most frequently in traditional commercial DBMSs and they include the widely used relational model as well as the network and hierarchical models. These models represent data by using record structures and hence are sometimes called record-based data models.
- Low level or Physical data models : These models provide concepts that describe the details of how the data is stored in the computer by representing information such as record formats, record orderings, and access paths. An access path is a structure that makes the search for particular database records efficient.
Schemas:
The description of a database in any data model is called the database schema which is specified during the database design and is not expected to change frequently. A displayed is called a schema diagram.
A schema diagram displays only some aspects of a schema, such as names of record types and data items, and some types of constraints.
Database State or Iinstance: The actual data in a database changes every time data is inserted, deleted, or modified. The data in the database at a particular moment in time is called a database state or a snapshot. It is also called the current set of occurrences or instances in the database.
Distinguish between Database State and Database Schema:
When a new database is defined, we specify its database schema only to the DBMS. At this point, the corresponding database state is empty state. The initial state of the database is got when the database is first populated or loaded with the initial data. From then on, every time an update operation is applied to the database, we get another database state.
Posted by
Sunflower
at
8/03/2009 11:03:00 AM
0
comments
Labels: Categories, Conceptual data model, Data Model, Database state, Databases, Instance, physical data model, representational data model, Schemas
|
| Subscribe by Email |
|
Introduction to Databases
Databases play an important role in almost all areas where they are used including business, engineering, medicine, law, education, and library science, to name a few.
A database is a collection of related data, where data means recorded facts. A typical database represents some aspect of the real world and is used for specific purposes by one or more groups of users. Databases are not specific to computers. Examples of non-computerized databases abound: phone book, dictionaries, almanacs, etc. A database has the following implicit properties :
1. A database represents some aspect of the real world.
2. A database is a logically coherent collection of data with some inherent meaning.
3. A databse is designed, built, and populated with data for a specific purpose.
4. A databse can be of any size and of varying complexity.
5. A database may be generated and maintained manually or it may be computerized.
A database management system (DBMS) is a collection of programs that enables users to create and maintain a database. The DBMS is a general-purpose software system that facilitates the process of defining, construction, and manipulating databases for different applications.
Defining a database involves specifying the data types, structures, and constraints for the data to be stored in the database.
Constructing a database is the process of storing the data itself on some storage medium that is controlled by the DBMS.
Manipulating a database includes such functions as querying the database to retrieve specific data, updating the database and generating the reports from the data.
CHARACTERSTICS THAT DISTINGUISH DATABASE APPROACH FROM TRADITIONAL FILE-PROCESSING APPLICATIONS :
- Existence of a catalog : It contains information such as structure of each file, the type and storage format of each data item and various constraints on the data. The information stored in catalog is called meta-data.
- Program data independence : In traditional file processing, the structure of a file is embedded in the access programs, so any changes to the structure of a file may require changing all programs that access this file. By contrast, the structure of data files is stored in DBMS catalog separately from access programs. This property is called program data independence.
- Program operation independence: Users can define operations on data as part of database applications. An operation is specified in two parts - interface of operation : includes operation name and data types of its arguments, implementation of operation : specified separately and can be changed without affecting the interface. This is called
program operation independence.
- Data abstraction : The characteristic that allows program data independence and program operation independence is called data abstraction.
- Support of multiple user views.
- Sharing of data among multiple transactions.
Main Categories of Database users are :
- Administrators.
- Designers.
- End users.
- System analysts and application programmers.
- DBMS system designers and implementers.
- Tool Developers.
- Operators and maintenance personnel.
Advantages of using Databases :
- Potential for enforcing standards.
- Reduced application development time.
- Flexibility.
- Availability of up-to-date information to all users.
- Economies of sale.
Posted by
Sunflower
at
8/03/2009 09:32:00 AM
0
comments
Labels: Advantages, Data, Databases, File processing systems, introduction, Properties, traditional
|
| Subscribe by Email |
|
Saturday, August 1, 2009
Overview Of The Application Layer
Computer networks are inherently insecure. To keep information secret, it must be encrypted. Encryption protocols fall into two general classes: secret key (e.g. DES, IDEA), and public key (e.g. RSA). Using these protocols is straight-forward; the hard part is key management.
In addition to providing secrecy, cryptographic protocols can also provide authentication. Finally, cryptography can also be used to allow messages to be signed in such a way that the sender cannot repudiate them after they have been sent. Naming in the Internet uses a distributed database system, DNS. Domain Name Server(DNS) holds records with IP addresses, mail exchanges, and other information. By querying a DNS server, a process can map an Internet domain name onto the IP address used to communicate with that domain.
As networks grow larger, they become harder to manage. For this reason, special network management systems and protocols have been devised, the most popular of which is SNMP. This protocol allows managers to communicate with agents inside devices to read out their status and issue commands to them.
Four major network applications are electronic mail, USENET news, the World Wide Web, and multimedia. Most email systems use the mail system defined in RFCs 821 and 822. Messages sent in this system use system ASCII headers to define message properties. These messages are sent using SMTP. Two systems for securing email exist, PGP and PEM.
USENET news consists of thousands of newsgroups on all manner of topics. People can join newsgroups locally, and can then post messages all over the world using the NNTP protocol, which has some resemblance to SMTP.
The World Wide Web is a system for linking up hypertext documents. Each document is a page written in HTML, possible with hyperlinks to other documents. A browser can display a document by establishing a TCP connection to its server, asking for the document, and then closing the connection. When a hyperlink is selected by the user, that document can also be fetched in the same way. In this manner, documents all over the world are linked together in a giant web.
Multimedia is the rising star in the networking firmament. It allows audio and video to be digitized and transported electronically for display. Most multimedia projects use the MPEG standards and transmit the data over ATM connections.
Posted by
Sunflower
at
8/01/2009 10:06:00 AM
0
comments
Labels: Computer networks, Cryptography, DNS, Security, The Application layer
|
| Subscribe by Email |
|
Overview Of The Transport Layer
The transport layer is the key to understanding layered protocols. It provides various services, the most important of which is an end-to-end, reliable, connection-oriented byte stream from sender to receiver. It is accessed through service primitives that permit the establishment, use and release of connection.
Transport protocols must be able to do connection management over unreliable networks. Connection establishment is complicated by the existence of delayed duplicate packets that can reappear at inopportune moments. To deal with them, three-way handshakes are needed to establish connections. Releasing a connection is easier than establishing one, but is still far from trivial due to the two-army problem.
Even when the network layer is completely reliable, the transport layer has plenty of work to do. It must handle all the service primitives, manage connections and timers, and allocate and utilize credits.
The main Internet transport protocol is TCP. It uses a 20-byte header on all segments. Segments can be fragmented by routers within the Internet, so hosts must be prepared to do reassembly. A great deal of work has gone into optimizing TCP performance, using algorithms from Nagle, Clark, Jacobson, Karn and others.
ATM has four protocols in the AAL layer. All of them break messages into cells at the source and reassemble the cells into messages at the destination. The CS and SAR sublayers add their own headers and trailers in various ways, leaving from 44 to 48 bytes of cell payload.
Network performance is typically dominated by protocol and TPDU processing overhead, and the situation gets worse at higher speeds. Protocols should be designed to minimize the number of TPDUs, context switches, and times each TPDU is copied. For gigabit networks, simple protocols using rate, rather than credit, flow control are called for.
Posted by
Sunflower
at
8/01/2009 09:47:00 AM
0
comments
Labels: ATM, Computer networks, Protocols, Transport layer
|
| Subscribe by Email |
|
Overview Of The Medium Access Sublayer
Some networks have a single channel that is used for all communication. In these networks, the key design issue is the allocation of this channel among the competing stations wishing to use it. Numerous channel allocation algorithms have been devised like :
- FDM : Dedicate a frequency band to each station.
- TDM : Dedicate a time slot to each station.
- Pure ALOHA : Unsynchronized transmission at any instant.
- Slotted ALOHA : Random transmission in well defined time slots.
- 1-persistent CSMA : Standard carrier sense multiple access.
- Nonpersistent CSMA : Random delay when channel is sensed busy.
- P-persistent CSMA : CSMA, but with probability of p of persisting.
- CSMA/CD : CSMA. but abort on detecting a collision.
- Bit Map : Round robin scheduling using a bit map.
- Binary countdown : Highest numbered ready station goes next.
- Tree walk : Reduced contention by selective enabling.
- Wavelength division : A dynamic FDM scheme for fiber.
- MACA, MACAW : Wireless LAN protocols.
- GSM : FDM plus TDM for cellular radio.
- CDPD : Packet radio within an AMPS channel.
- CDMA : Everybody speak at once but in different language.
- Ethernet : CSMA/CD with binary exponential backoff.
- Token bus : Logical ring on a physical bus.
- Token Ring : Capture the token to send a frame.
- DQDB : Distributed queuing on a two-bus MAN.
- FDDI : Fiber-optic token ring.
- HIPPI : Crossbar using 50-100 twisted pairs.
- Fibre channel : Crossbar using fiber optics.
- SPADE : FDM with dynamic channel allocation.
- ACTS : TDM with centralized slot allocation.
- Binder : TDM with ALOHA when slot owner is not interested.
- Crowther : ALOHA with slot owner getting to keep it.
- Roberts : Channel time reserved in advance by ALOHA.
FDM and TDM are efficient when the number of stations is small and the traffic is continous.
ALOHA protocol, with and without slotting and control, has been proposed when the number of stations is large and variable.
BINARY COUNTDOWN completely eliminates contention.
TREE WALK reduces contention by dynamically dividing the stations into two disjoint groups, one of which is permitted to transmit and one of which is not.
WIRELESS LANs have their own problems and solutions. The biggest problem is caused by hidden stations, so CSMA does not work. MACA attempts to stimulate transmissions around the destination, to make CSMA work better.
GSM, CDPD and CDMA are widely used for mobile computers and telephones.
The IEEE 802 LANs are : CSMA/CD, TOKEN BUS, and TOKEN RING. Each of these has its unique advantages and disadvantages, and each has found its own user community.
FDDI, FAST ETHERNET, HIPPI, and FIBER CHANNEL offer bandwidth in the 100 Mbps range and up.
Posted by
Sunflower
at
8/01/2009 09:04:00 AM
0
comments
Labels: ALOHA, CDMA, CDPD, Channels allocation algorithms, Computer networks, CSMA, FDM, GSM, Medium Access SubLayer, TDM
|
| Subscribe by Email |
|