You are on page 1of 6

Relational Database Components

SQL Server 2000 The database component of Microsoft SQL Server 2000 is a Structured Query Language (SQL)based, scalable, relational database with integrated Extensible Markup Language (XML) support for Internet applications. Each of the following terms describes a fundamental part of the architecture of the SQL Server 2000 database component: Database A database is similar to a data file in that it is a storage place for data. Like a data file, a database does not present information directly to a user; the user runs an application that accesses data from the database and presents it to the user in an understandable format. Database systems are more powerful than data files in that data is more highly organized. In a well-designed database, there are no duplicate pieces of data that the user or application must update at the same time. Related pieces of data are grouped together in a single structure or record, and relationships can be defined between these structures and records. When working with data files, an application must be coded to work with the specific structure of each data file. In contrast, a database contains a catalog that applications use to determine how data is organized. Generic database applications can use the catalog to present users with data from different databases dynamically, without being tied to a specific data format. A database typically has two main parts: first, the files holding the physical database and second, the database management system (DBMS) software that applications use to access data. The DBMS is responsible for enforcing the database structure, including: Maintaining relationships between data in the database. Ensuring that data is stored correctly, and that the rules defining data relationships are not violated. Recovering all data to a point of known consistency in case of system failures.

Relational Database Although there are different ways to organize data in a database, relational databases are one of the most effective. Relational database systems are an application of mathematical set theory to the problem of effectively organizing data. In a relational database, data is collected into tables (called relations in relational theory). A table represents some class of objects that are important to an organization. For example, a company may have a database with a table for employees, another table for customers, and another for stores. Each table is built of columns and rows (called attributes and tuples in relational theory). Each column represents some attribute of the object represented by the table. For example, an Employee table would typically have columns for attributes such as first name, last name, employee ID, department, pay grade, and job title. Each row represents an instance of the object represented by the table. For example, one row in the Employee table represents the employee who has employee ID 12345. When organizing data into tables, you can usually find many different ways to define tables. Relational database theory defines a process called normalization, which ensures that the set of tables you define will organize your data effectively. Scalable SQL Server 2000 supports having a wide range of users access it at the same time. An instance of SQL Server 2000 includes the files that make up a set of databases and a copy of the DBMS software. Applications running on separate computers use a SQL Server 2000 communications component to transmit commands over a network to the SQL

Server 2000 instance. When an application connects to an instance of SQL Server 2000, it can reference any of the databases in that instance that the user is authorized to access. The communication component also allows communication between an instance of SQL Server 2000 and an application running on the same computer. You can run multiple instances of SQL Server 2000 on a single computer. SQL Server 2000 is designed to support the traffic of the largest Web sites or enterprise data processing systems. Instances of SQL Server 2000 running on large, multiprocessor servers are capable of supporting connections to thousands of users at the same time. The data in SQL Server tables can be partitioned across multiple servers, so that several multiprocessor computers can cooperate to support the database processing requirements of extremely large systems. These groups of database servers are called federations. Although SQL Server 2000 is designed to work as the data storage engine for thousands of concurrent users who connect over a network, it is also capable of working as a stand-alone database directly on the same computer as an application. The scalability and ease-of-use features of SQL Server 2000 allow it to work efficiently on a single computer without consuming too many resources or requiring administrative work by the stand-alone user. The same features allow SQL Server 2000 to dynamically acquire the resources required to support thousands of users, while minimizing database administration and tuning. The SQL Server 2000 relational database engine dynamically tunes itself to acquire or free the appropriate computer resources required to support a varying load of users accessing an instance of SQL Server 2000 at any specific time. The SQL Server 2000 relational database engine has features to prevent the logical problems that occur if a user tries to read or modify data currently used by others. Structured Query Language To work with data in a database, you have to use a set of commands and statements (language) defined by the DBMS software. Several different languages can be used with relational databases; the most common is SQL. The American National Standards Institute (ANSI) and the International Standards Organization (ISO) define software standards, including standards for the SQL language. SQL Server 2000 supports the Entry Level of SQL-92, the SQL standard published by ANSI and ISO in 1992. The dialect of SQL supported by Microsoft SQL Server is called Transact-SQL (TSQL). T-SQL is the primary language used by Microsoft SQL Server applications. Extensible Markup Language XML is the emerging Internet standard for data. XML is a set of tags that can be used to define the structure of a hypertext document. XML documents can be easily processed by the Hypertext Markup Language, which is the most important language for displaying Web pages. Although most SQL statements return their results in a relational, or tabular, result set, the SQL Server 2000 database component supports a FOR XML clause that returns results as an XML document. SQL Server 2000 also supports XPath queries from Internet and intranet applications. XML documents can be added to SQL Server databases, and the OPENXML clause can be used to expose data from an XML document as a relational result set.

COMPONENTS OF DATABASE SYSTEM A database system is composed of four components; Data Hardware Software Users which coordinate with each other to form an effective database system.

Fig. 1.1 Data Base System

1. Data - It is a very important component of the database system. Most of the organizations generate, store and process 1arge amount of data. The data acts a bridge between the machine parts i.e. hardware and software and the users which directly access it or access it through some application programs. Data may be of different types. User Data - It consists of a table(s) of data called Relation(s) where Column(s) are called fields of attributes and rows are called Records for tables. A Relation must be structured properly. Metadata - A description of the structure of the database is known as Metadata. It basically means "data about data". System Tables store the Metadata which includes. - Number of Tables and Table Names - Number of fields and field Names - Primary Key Fields Application Metadata - It stores the structure and format of Queries, reports and other applications components. ' 2. Hardware - The hardware consists of the secondary storage devices such as magnetic disks (hard disk, zip disk, floppy disks), optical disks (CD-ROM), magnetic tapes etc. on which data is stored together with the Input/Output devices (mouse, keyboard, printers), processors, main memory etc. which are used for storing and retrieving the data in a fast and efficient manner. Since database can range from those of a single user with a desktop computer to those on mainframe computers with thousand of users, therefore proper care should be taken for choosing appropriate hardware devices for a required database. 3. Software - The Software part consists of DBMS which acts as a bridge between the user and the database or in other words, software that interacts with the users, application programs, and database and files system of a particular storage media (hard disk, magnetic tapes etc.) to insert, update, delete and retrieve data. For performing these operations such as insertion, deletion and updation we can either use the Query Languages like SQL, QUEL, Gupta SQL or application softwares such as Visual 3asic, Developer etc. 4. Users - Users are those persons who need the information from the database to carry out their primary business responsibilities i.e. Personnel, Staff, Clerical, Managers, Executives etc. On the basis of the job and requirements made by them they are provided access to the database totally or partially. The various types of users which can access the database are: Database Administrators (DBA) Database Designers End Users Application Programmers

Components of a database
Jul 16, 1999 - Chris Cruickshank

Last week saw the start of what a relational database is about - and databases in general. This week takes it one stage further by looking at the component parts of what makes up a database. Some of you may be sitting there thinking, "Why do I need to know this? What's the point?" The point is so that you can expand your knowledge through books etc. When you do, you will come across the "Jargon" so it's important to know what these things are.
Tables, Columns and Rows These three items form the building blocks of a database. They store the data that we want to save in our database. Columns

Columns are akin to fields, that is, individual items of data that we wish to store. A customer's name, the price of a part, the date of an invoice are all examples of columns. They are also similar to the columns found in spreadsheets (the A, B, C etc along the top). Rows Rows are akin to records as they contain data of multiple columns (like the 1,2,3 etc in a spreadsheet). Unlike file records though, it is possible to extract only the columns you want to make up a row of data. Old "records" that computers read forced the computer to read EVERYTHING, even if you only wanted a tiny portion of the record. In databases, a row can be made up of as many or as few columns as you want. This makes reading data much more efficient - you fetch what you want. Tables A table is a logical group of columns. For example, you may have a table that stores details of customers' names and addresses. Another table would be used to store details of parts and yet another would be used for supplier's names and addresses. It is the tables that make up the entire database and it is important that we do not duplicate data at all. Onlykeys would duplicate (and even then, on some tables - these would be unique). Keys Keys are used to relate one table for another. For example. A customer places an order for some parts. We need to store the customer's details, the parts ordered and the supplier of the parts (to ensure we have enough stock or place a new order to restock). How do we "link" all this information together? How can we separate one customer's order from another? Suppose we have the following tables to store this information.
The copyright of the article Components of a database in PC Support is owned by Chris Cruickshank. Permission to republish Components of a database in print or online must be granted by the author in writing.

Go To Page: 1 2 3

Components of a database - Page: 2


Jul 16, 1999 - Chris Cruickshank

Customer Details
Customer Order Parts Supplier We allocate a unique customer number on customer details - that is, every customer on customer details has a unique number. When an order is placed, that number is placed on Customer Order. A row will be produced for every order a customer makes. We have "joined" these two tables using a key - Customer Number. Using this key we can find out all the order that customer "1" has made. On Customer Order we will use another key to identify the parts they have ordered. Each part on the Part table will (like the customer) be unique. On the Part table, a supplier number is used to link each part to a supplier. On some tables (such as Customer Detail, Part and Supplier) the key is unique - we only have "one" of each. On other tables Customer Order, we have "many" keys of the same value. This is known as a "One to many" relationship and is very common in databases. That means, one record in Customer Detail relates to many records on Customer Order.

Rather than storing the name and address of the customer on the Customer Order table, the short Customer Number is used instead making things much more efficient (see last week's article on this topic). There are (usually) two types of keys used in databases. Primary Keys and Foreign Keys. A Primary key is a column (or columns keys are not restricted to just one column but can be made up or two or more columns), that is used when this table is searched. Primary keys should always be unique and are the main way a table is accessed. Foreign keys are those keys on a table that are used to join to another table. So on Customer Order; the customer number is a foreign key as it is used to find out which customer placed the order. A table can have more than one foreign key (the "part number" would also be a foreign key). Forms Forms are used to enter or look at data. They are the screens that make up the application that allows us to enter and retrieve data. Each "field" on a form usually relates to a column on the database but this is not always the case. For example, suppose you have a field that shows a total of two or more items on a form. The total would NOT be stored on
The copyright of the article Components of a database in PC Support is owned by Chris Cruickshank. Permission to republish Components of a database in print or online must be granted by the author in writing.

Go To Page: 1 2 3

Components of a database - Page: 3


Jul 16, 1999 - Chris Cruickshank

on the database. Why? Because if one of the columns were incorrectly updated, you wouldn't know which was incorrect. For example. Suppose you had 3 columns on a table - A, B and C. A is equal to B + C. Suppose the columns contain the following values:
A = 11 B=7 C=5 Which column is wrong? You might think that A is wrong, but perhaps B should be equal to 6 or maybe C should be 4. You just don't know. This is why derived items are not stored on the database but can be shown on a form. The form should have some form of validation so that the user cannot enter "rubbish" onto the database. Numbers must store numbers; dates should store dates and so on. Depending on the application, there can be some very complex validation. Reports It is all very well placing all this data into the database, but if you cannot access it in a format that you want (usually on paper), then it is extremely limited in use. Every database should have some kind of reporting facility and I usually find that the report side of things is what makes a good (or bad) database application/package. Reports should be easy to produce and be quick. Simple reports should be so easy to produce that anyone can do it. More complex reports will need someone with programming/database knowledge, as it is possible to produce really silly results! Query

Queries are little programs that let the user ask questions. Things like "Give me a list of all the customers who ordered something last month" or "List all customers in a specific area". Queries can and often are the foundation of reports (in that a report can be based on the results of a query). Depending on the database, queries can be constructed on screen or you may even be able to type in a query command direct. Queries often use a language called "SQL" (Structured Query Language) which is a computer language that makes accessing databases simple. These then are the general components of what makes up a database. Next week, we take a simple look at some basic design concepts for your tables. Till then.
The copyright of the article Components of a database in PC Support is owned by Chris Cruickshank. Permission to republish Components of a database in print or online must be granted by the author in writing.

Go To Page: 1 2 3

You might also like