Task 9. 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 a database design is to store information so that it is easy to access and maintain (aim).

2.    The treatment of the first and the 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’s needs, but the 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).

Task 10. Fill in the gaps in the text.

The first step in designing a relational data base is to define its fields by specifying a ___and data type. Integer, date and ___ data types are used for the fields that might be mathematically manipulated. The ___ data type is used for fixed-length fields containing a 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.

 

Task 11. Read the text and do the tasks below.

TEXT 21 B. SQL

Adding records, finding information and making updates are all the 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 example, the command word DELETE removes a record from the table, the command word CREATE creates a database or a 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 the 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 a 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 the 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 it 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 accomplishes 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 the 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’s 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 the tables that can be related to the fields that exist in both tables. In SQL terminology, the creating a relationship between tables is referred to as joining tables. To take the advantage of the relationship between two tables, you first have to join the tables. Why? Remember that in a relational database, the tables are essentially independent unless you join them together. The SQL JOIN command allows you to join temporarily 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.

 


Дата добавления: 2018-10-26; просмотров: 157; Мы поможем в написании вашей работы!

Поделиться с друзьями:






Мы поможем в написании ваших работ!