Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






DATABASE DESIGN

 

The key to an effective database is its initial design. In a well-designed database, data can be flexibly manipulated to produce timely, meaningful, and accurate information for decision making. Bad database design can lead to messy database, lost records, and inaccurate data. The goal of database design is to store information so that it easy to access and maintain, but concise enough to take up as little disk space as possible.

The term database structure refers to the arrangement of fields, tables, and relationships in a database. The first step in structuring a relational database is to determine what data must be collected and stored. To do so, a database designer might begin by consulting users and studying the current filing system to compile a list of available data as well as any additional data necessary to produce on-screen output or printed reports.

After the designer determines what data to store, the next step is to organize that data into fields. It is usually easy to break data into fields just by using common sense and considering how people might want to access the data. Any data that people would to search for, sort on, or use in a calculation should be in its own field. The treatment of first and last name illustrates the concept of breaking data into fields. A database designer could define a field called Name to hold an entire customer’s name. With the entire name in one field, however, the database would not be able to access individual parts of the name, making it difficult to alphabetize customers by last name or to produce a report in which names appear in one field. That’s why the last names are stored in a different field than first names.

Although two people might have, for example, the same name or two paychecks might contain the same amount, a computer must have some way to differentiate between records. A primary key is a field that contains data unique to a record.

The data that can be entered into a field depends on the field’s data type. From a technical perspective, data type specifies the way data is represented on the disk and in RAM. From a user perspective, the data type determines the way data can be manipulated. When designing a database, each field is assigned a data type. Data can be broadly classified as numeric or character. Character data contains letters, numerals and symbols not used for calculations. Numeric data contains numbers that can be manipulated mathematically by adding, averaging, multiplying and so forth. The are several numeric data types, including real, integer, and date. The real data type is used for fields that contain numbers with decimal places- prices, percentages, and so on. The integer data type is used for fields that contain whole numbers-quantities, repetitions, rankings, and so on. The date data type is used to store dates in a format that allows them to be manipulated, such as you want to calculate the numbers of days between two dates.

The text data type is typically assigned to fixed-length fields that hold character data- people’s names, albums titles, and so on. Text fields sometimes hold data that looks like numbers, but doesn’t need to be mathematically manipulated. Telephone numbers and ZIP codes are examples of data that looks numeric, but should be stored in text fields. A memo data type usually provides a variable-length field into which users can enter comments. The logical data type (sometimes called a Boolean or yes/no data type) is used for true/false or yes/no data using minimal storage space. Some file and database management systems also include additional data types, such as BLOBs and hyperlinks. A BLOB (binary large object) is a collection of binary data stored in a single field of a database. BLOBs can be just about any kind of data you would store as a file, such as an MP3 music track. The hyperlink data type stores URLs used to link directly from a database to a Web page.



The information produced by reports and processing routines is only as accurate as the information in the database. Unfortunately, data entry errors can compromise the accuracy and validity of a database. When designing a database, it is important to think ahead and envision potential data entry errors. Preventing every typographical error is not possible. However, it is possible to catch some of these errors by using field validation rules, list boxes, or lookups. A process called normalization helps to create a database structure that can save storage space and increase processing efficiency. The goal of normalization is to minimize data redundancy – the amount of data that is repeated or duplicated in a database.

Records in a database can be organized in different way depending how people want to use them. No single way of organizing the data accommodates everyone need’s, but tables can be sorted or indexed in multiple ways. A table’s sort order is the order in which records are stored on disk. Sorted tables typically produce faster queries and updates. In a sorted table, new records are inserted to maintain the order. Most DBMSs use a sort key to determine the order in which records are stored. A table’s sort key is one or more fields used to specify where new records are inserted in a table. A database index can be used to organize data in alphabetic or numeric order. A database index contains a list of keys, and each key provides a pointer to the record that contains the rest of the fields related to that key.

Designing the database user interface can be a challenging task. If a company’s database includes multiple tables used by many different people, a professional user interface designer usually creates and maintains the user interface. Large databases might even require a group of user interface designers, meanwhile the interfaces for smaller databases, such as those used by small business or individuals, is most likely created by a single one.

A well-defined user interface for a database should be clear, intuitive, and efficient. A designer might consider the following principles:

- Arrange fields in a logical order beginning at the top-left of the screen. The first field should be those used most often or those that come first in the data entry sequence.

- Provide visual clues to the entry areas. An edit box, line, or shaded area can delineate data entry areas.

- Entry areas should appear in a consistent position relative to their labels. By convention, labels are placed left of the entry areas or above them.

- Provide a quick way to move through the fields in order. By convention, the tab key performs this function.

- If all fields do not fit on a single screen, use scrolling or create a second screen.

- Provide buttons or other easy-to-use controls for moving from one record to another.

- Supply on-screen instructions to help ensure that data is entered correctly. Web database can benefit from links to help pages.

After the design for the database structure is completed, it is time to load the database with an initial set of data. Data can be loaded into a database manually by using generic data entry tools supplied with the DBMS or by using a customized data entry module created by the database designer. Entering data manually can take a long time, however, and mistakes such as misspelling are common. If the data exists electronically in another type of database or in flat files, it is usually possible to transfer the data using a custom-written conversion routine or import and export routines. A conversion routine converts the data from its current format into a format that can be automatically incorporate into the new database. It takes some time and requires knowledge about database formats to write conversion routines, but for large databases, it’s much quicker to convert data than to re-enter it manually. Converting data also results in fewer errors.

Some DBMSs provide built-in import and export routines that automatically convert data from one file format to another. An import routine brings data into a database. For example, if data was previously stored as a spread-sheet file, an import routine in Microsoft Access can be used to transfer data from the spreadsheet to an Access database. In contrast, an export routine copies data out of a software package, such as spreadsheet software, and into the database. Typically, you would use either an import routine or an export routine to move data from one location to another, but not both.

 

Comprehension check. Choose the ending for each sentence from the two versions given.

1. The key to an effective database is

a) its initial design.

b) to determine what data must be collected and stored.

2. The term database structure refers to

a) the arrangement of fields, tables, and relationships in a database.

b) the concept of breaking data into fields.

3. From a technical perspective, data type specifies

a) the way data can be manipulated.

b) the way data is represented on the disk and in RAM.

4. Character data contains

a) letters, numerals and symbols not used for calculations.

b) numbers that can be manipulated mathematically.

5. The goal of normalization

a) to produce timely, meaningful, and accurate information for decision making.

b) is to minimize data redundancy-the amount of data that is repeated or duplicated in a database.

6. After the design for the database structure is completed, it is time

a) to determine the order in which records are stored.

b) to load the database with an initial set of data.

 

Vocabulary practice

1. Which word does not belong to the group?

a) initial, original, primary, subsequent;

b) allow, permit, let, advice (verb + object + to);

c) current, visual, intuitive, efficiently;

d) carry out, execute, fulfill, specify;

e) reduce, decrease, minimize, grow up;

f) tool, device, equipment, gadget.

 

2. Fill in the blanks choosing from the variants given.

1. In a well-designed database, data can be … manipulated to produce timely, meaningful, and accurate information for decision making.

a) flexibly b) smoothly c) slowly d) hardly

2. The term database structure refers to the … of fields, tables, and relationships in a database.

a) agreement b) allocation c) arrangement d) appointment

3. A primary key is a … that contains data unique to record.

a) space b) field c) table d) file

4. When designing a database, you should … and envision potential data entry errors.

a) think ahead b) think about c) think over d) think out

5. Entering data … can take a long time, however, and mistakes such as misspelling are common.

a) electronically b) automatically c) in written form d) manually

6. A conversion routine … the data from its current format into a format that can be automatically incorporate into the new database.

a) provides b) transfers c) converts d) supplies

 

3. Transform the given sentences using the word in brackets without any change in meaning. You may omit, change or add words as required.

1. The goal of database design is to store information so that it easy to access and maintain (aim).

2. The treatment of first and last name illustrates the concept of breaking data into fields (shows).

3. BLOBs can be just about any kind of data you would typically store as a file, such as an MP3 music track (usually).

4. The information produced by reports and processing routines is only as accurate as the information in the database (exact).

5. No single way of organizing the data accommodates everyone need’s, but tables can be sorted or indexed in multiple ways (satisfies).

6. Typically, you would use either an import routine or an export routine to move data from one location to another, but not both. (place).

 

4. Fill in the gaps in the text.

 

The first step in designing relational data base is to define its fields by specifying a ___and data type. Integer, date and ___ data types are used for fields that might be mathematically manipulated. The ___ data type is used for fixed-length fields containing text that is not intended to be mathematically manipulated. The ___ data type is a variable-length field for entering text. The ___ data type is used to store true/false or yes/no data. The ___ data type is used to store binary data, such as MP3 files or graphics. When designing fields, a database designer can also include field formats, field ___ rules, and lookup routines to reduce data entry errors.

 

Speaking. Discuss the following questions.

 

1. What is the goal of a well-designed database?

2. What does the term database structure refer to?

3. Speak on the first step in structuring a relational database? What is the next step?

4. Why are last names stored in a different field than first names?

5. What does make each record unique?

6. How does a database designer know what data types to use?

7. Can a database designer prevent people from entering inaccurate data?

8. What is normalization?

9. What are the principles that a designer might consider to improve this database?

10. How is data loaded into database tables?

 

Text D

 

Pre-reading task. Match the meaning of the following English words with their Russian definitions.

Reading. Read the text and try to guess the meaning of the words in bold. Check your variants in the dictionary.

 

SQL

 

Adding records, finding information and making updates are all important aspects of database use. Most people who access a database on a “casual” basis interact with very simple user interfaces. These user interfaces shield users from the intricacies of sophisticated query languages. Nevertheless, a little background in query languages can help you understand the power and capabilities of databases.

Query languages like SQL (Structured Query Language) typically work behind the scenes as an intermediary between the database client software provided to users and the database itself. Database client software provides an easy-to-use interface for entering search specifications, new records, data updates, and so on. The client software collects your input, and then converts it into an SQL query, which can operate directly on the database to carry out your instructions.

An SQL query is a sequence of words, much like a sentence. Most implementations of SQL accept either uppercase or lowercase keywords.

The SQL query language provides a collection of special command words called SQL keywords, such as SELECT, FROM, INSERT, and WHERE, which issue instructions to the database. Most SQL queries can be divided into three simple elements that specify an action, the name of database table, and a set of parameters. Let’s look at each of these elements.

An SQL query typically begins with an action keyword, or command, which specifies the operation you want to carry out. For examples, the command word DELETE removes a record from a table, the command word CREATE creates a database or table, the command word INSERT is used to add a record, the command word JOIN uses the data from two tables, SELECT searches for records and UPDATE changes data in the field.

SQL keywords such as USE, FROM, or INTO can be used to construct a clause specifying the table you want to access. The clause consists of a keywords followed by the name of the table. For example, the clause FROM Tracks indicates that you want to use the Tracks table from the Vintage Music Shop’s database.

The term parameter refers to detailed specifications for a command. Keyword such as WHERE usually begin an SQL clause containing the parameters for a command.

One of the most common database operations is to query for a particular record or group of records by using the SELECT command. The phrase, for example, SELECTAlbumTitle, Album Cover specifies that the database should show you only the album title and cover, and until you confirm that is the album you are interested in, it will not show you additional information such as the price or list of tracks.

You can change records in a database only if you have authorization to do so. At Vintage Music Shop’s site, for example, customers do not have authorization to change album prices or alter the name of the songs on an album. The process of purchasing an album, however, does cause an update in the whole database. Your purchase just reduces the number of albums in the shop’s inventory. To accomplish this update, one of the software modules in the shop’s inventory system issues an SQL UPDATE command to reduce the number in the InStock field record. In addition to changing the data in a single record, SQL can perform a global update that changes the date in more than one record at a time. It means that is possible to update a group of records. Suppose you’re Vintage Music Shop’s marketing manager, and you want to put all The Rolling Stones albums on sale by reducing the DiscountPrice to $9.95. You could do it the hard way by searching for an ArtistName field that contains “Rolling Stones”, adjusting the DiscountPrice field for that record, and then looking for the next Rolling Stones album. However, it would be easier to change all records with a single command. The following SQL statement accomplish this global update:

UPDATE Albums

SET DiscountPrice=9.95

WHERE ArtistName=”Rolling Stones”

Let’s see how this command performs a global update. The UPDATE command means you want to change the data in some or all of records. Albums is the name of the record type containing the data you want to change. SET DiscountPrice=9.95 tells the DBMS to change the data in the DiscountePrice field to $9.95. WHERE ArtistName=”Rolling Stones” tells the DBMS to change only those records where the artist name is Rolling Stones. Although the global update function is powerful, it works only for records that have similar characteristics.

Recall that the process of normalization creates tables that can be related by fields that exist in both tables. In SQL terminology, the creating a relationship between tables is referred to as joining tables. To take advantage of the relationship between two tables, you first have to join the tables. Why? Remember that in relational database, the tables are essentially independent unless you join them together. The SQL JOIN command allows you to temporarily join and simultaneously access the data in more than one table.

SQL is a very extensive and powerful language that can be used not only to manipulate data, but also to create databases, tables and reports. Because SQL is one of the most popular database tools, many computer professionals consider SQL fluency as essential career skill.

 

Comprehension check. Match the beginning of the sentences in the first column with the endings in the second.

1. Adding records, finding information, and making updates 2. Query languages like SQL typically work behind the scenes 3. Database client software provides 4. An SQL query is 5. The process of purchasing an album 6. The SQL JOIN command allows you a) as an intermediary between database client software provided to users and the database itself. b) are all important aspects of database use. c) a sequence of words, much like a sentence. d) only if you have authorization to do so. e) an easy-to-use interface for entering search specifications, new records, data updates and so on. f) does cause an update in the whole database. Your purchase just reduce the numbers of albums in the shop’s inventory.

 

Vocabulary practice

1. Put the letters in the words in brackets into the correct order.

1. A little … in query languages can help you understand the power and capabilities of databases (roducknabg).

2. An SQL query typically begins with an action …, or command, which specifies the operation you want to carry out (weykdor).

3. The clause consists of a keywords followed by the name of the … (ablet).

4. Your … just reduces the numbers of albums in the shop’s inventory (sacherup).

5. The term … refers to detailed specifications for a command (earpmaret).

6. Although the global update function is powerful, it works only for … that have similar characteristics (coerdrs).

 

2. Fill in the blanks choosing from the variants given.

1. Most people who access a database on a “casual” basis … with very simple user interface.

a) manipulate b) work c) operate d) interact

2. A little … in query languages can help you understand the capabilities of databases.

a) certainty b) background c) career skills d) experience

3. The SQL query language provides a collection of special command … called SQL keywords, such as SELECT, FROM, INSERT, and WHERE, which issue instructions of the database.

a) words b) passwords c) names d) numbers

4. Most SQL queries can be divided into three simple elements that … an action, the name of database table, and a set of parameters.

a) execute b) indicate c) construct d) specify

5. Customers do not have … to change album prices or alter the name of the songs on an album.

a) authorization b) rights c) permission d) possibilities

6. SQL is a very extensive and powerful language that can be used not only to … data, but also to create databases, tables and reports.

a) enter b) manipulate c) to make updates d) input

 

3. Match the beginnings and the endings of the steps given and put them into correct order.

1 SET DiscountPrice=9.95 tells 2. WHERE ArtistName=”Rolling Stones” tells 3. Albums is 4. The UPDATE command means 5. It means that 6. SQL can perform a global update a) the name of the record type containing the data you want to change. b) to change the data in the DiscountePrice field to $9.95. c) to change only those records where the artist name is Rolling Stones. d) you want to change the data in some or all of records. e) that changes the date in more than one record at time. f) is possible to update a group of records.

4. Fill in the gaps in the text.

SQL is a database query language that typically works behind the scenes as an intermediary between the database ___ software provided to users and the database itself. Although the specifications for searchers and other database tasks are collected by easy-to use graphical user interfaces, those specifications are converted into SQL ___ which can communicate directly with the database. An SQL query contains SQL ___ such as SELECT, FROM, INSERT, JOIN and WHERE, plus ___ that specify the details of the command. Records can be removed from a database using the SQL ___ command. Record can be added to a table using the SQL ___ command. To search for data, you can use the SQL ___ command. To change or replace the data in a field requires the SQL ___ command.

 

Speaking. Discuss the following questions.

 

1. What are the most important aspects of database use?

2. Why is so important to have a little background in query languages?

3. What does the abbreviation SQL stand for?

4. How does a query language like SQL work?

5. What does a simple SQL query look like?

6. How does SQL specify the action that someone wants carried out in the data base? Speak on the most commonly used SQL command words.

7. How does SQL specify which table to use?

8. How do SQL queries carry out searches?

9. Is it possible to change the contents of records or to update a group of records? What does the process of purchasing cause?

10. How is the date retrieved from more than one table at a time? What command does allow you to access the data in more than one table?

 

Critical thinking. Read the article and express your opinion on the problem.


Date: 2015-01-12; view: 1835


<== previous page | next page ==>
DATA MANAGEMENT TOOLS | Privacy
doclecture.net - lectures - 2014-2024 year. Copyright infringement or personal data (0.014 sec.)