当前位置:文档之家› SQL Extensions and Algebras for Object-Oriented Query Languages Contents

SQL Extensions and Algebras for Object-Oriented Query Languages Contents

SQL Extensions and Algebras for Object-Oriented Query Languages Contents
SQL Extensions and Algebras for Object-Oriented Query Languages Contents

SQL Extensions and Algebras for Object-Oriented

Query Languages

Carolina Culik,Randall Mack and Dave Shewchun

Contents

1Introduction3 2Query Languages3

2.1What is a Query Language? (3)

2.1.1Purpose (3)

2.1.2Characteristics (3)

2.1.3Design (4)

2.2RELOOP (5)

2.2.1Syntax (6)

2.2.2Accessing Nested Structures (7)

2.2.3Constructing New Entities (8)

2.2.4Nested Structures (8)

2.2.5Some Additional RELOOP Facilities (9)

2.2.6Aggregate Operators (10)

2.3OSQL (10)

2.3.1Syntax (11)

2.3.2Referencing Objects Through Keys (11)

2.3.3Using Functions in Queries (12)

2.3.4Accessing Nested Data (12)

2.3.5Aggregate Functions (13)

3Algebras for Object-oriented Database Systems13

3.1An Algebra for EXTRA/EXCESS (13)

3.1.1The EXTRA Data Model (13)

3.1.2The EXCESS Query Language (14)

3.1.3The Algebra (14)

3.1.4Operators (14)

3.1.5Examples (16)

3.2An Algebra for ENCORE (16)

3.2.1The ENCORE Data Model (16)

3.2.2Operators (17)

1

2Culik,Mack and Shewchun

3.3An Algebra for RELOOP (19)

3.3.1RELOOP (19)

3.3.2The O2Data Model (19)

3.3.3Algebra Operators (19)

3.3.4Example (20)

3.4An Algebra for OODAPLEX (21)

3.4.1OODAPLEX Data Model (21)

3.4.2OODAPLEX Queries (21)

3.4.3OOAlgebra (22)

3.4.4OOAlgebra Operators (22)

3.4.5Examples (23)

3.5Conclusions (24)

4Overall Conclusions25

SQL Extensions and Algebras for OODBMS3 1Introduction

The query language used to access a database and the underlying algebra form one of the most important components of a database management system.We will discuss the issues involved in the design of a query language,examine several SQL-like query languages and review several possible algebras for the object-oriented model.

The emphasis in this paper is on practical,user-friendly models.Query languages which are attempts at extending SQL to the object-oriented model were chosen because of the large population of users already familiar with SQL,as well as its simplicity and formal basis.

2Query Languages

In this section we introduce the concept of a query language,explaining some of the issues which a?ect its design and use.We analyze in depth the query languages RELOOP for the O2[CDLR89] object-oriented database management system(OODBMS)and OSQL[FAC+89]for Iris OODBMS.

2.1What is a Query Language?

2.1.1Purpose

Query languages are used for four main purposes[BCD89].

1.for interactive queries

2.to access the database from a programming language

3.for simple programming tasks

4.to simplify complicated programming tasks

However,these four modes of use do not apply equally to all query languages.In general,object-oriented query languages are intended to merge smoothly with the programming language.This means that a programmer should be able to access the database directly from the host language, removing the need to use the query language for this purpose.On the other hand,traditional SQL embeddings only permit modi?cation of the database through SQL queries and the lack of close ties between the two languages will preclude using SQL for programming shortcuts.

Despite the variety of uses to which a query language can be put,we will concentrate on its aptness for phrasing interactive queries.From the perspective of object-oriented query languages, that is certainly the most fundamental application.Any other purpose can be seen as more of a useful side-e?ect.

2.1.2Characteristics

An ad hoc query language should have several characteristics:it should be possible to simply and concisely express reasonable queries;the run-time system should be able to?nd a good strategy for obtaining the result;and it should be independent of any speci?c application.As well,the interactive query language need not be as powerful as a complete programming/query language combination.Simplicity is more important.

4Culik,Mack and Shewchun

2.1.3Design

There are many issues involved in the design of a query language.A sample of some of the more critical ones might be[BCD89]:

?Should encapsulation be supported?

?What form will the answer take?

?Will the query language be integrated into the host language?

?Should queries be explicitly typed?

From the point of view of an ad hoc query language for an OODBMS,we can provide tentative answers to these questions.

Encapsulation

Encapsulation is the concept of packaging a set of methods with any given item of data,where only the methods will be visible to the user.Essentially this notion is just abstract data types as applied to an object-oriented language,and current wisdom says that the use of abstract data types is a good thing.

From this we can see that for queries buried in a programming language,encapsulation is a must.However,for interactive queries it is not so obvious.The main reason for encapsulation(to enforce modularity in programs)does not apply here.It is also easy to come up with examples where encapsulation would signi?cantly hamper the user.For example[BCD89],a user does not want to query a stack through push and pop operations,he wants to be able to see the entire stack.

It appears that the best approach would be to enforce encapsulation for embedded queries,but relax this restriction at the interactive level.

Form of the Answer

There are essentially three options for how to represent/store the value returned from a query.

1.Queries can only return information in the form in which it currently exists in the database.

2.Query results belong to a meta-class which has pre-de?ned methods permitting displaying

and printing.

3.A new class and methods permitting access to all of its?elds are dynamically de?ned for

every query result.

Option one is too restrictive for many purposes.Option three requires more overhead than most OODBMS’s can spare.This leaves option two as the most reasonable compromise,but re-using the results can cause problems if encapsulation is enforced.We see a tradeo?between encapsulation and the power/e?ciency of the language.

SQL Extensions and Algebras for OODBMS5 Embedding the Query Language

The most important thing to remember about this topic is that one of the major objectives in the design of OODBMS’s is to remove the impedance mismatch found with relational systems. Assuming that problem is avoided,we have one remaining choice.Whether to make the query language a subset of the programming language,or merely ensure that it mixes well enough that calls from within the programming language are natural.While either is acceptable it would appear that making the query language a subset of the programming language would be https://www.doczj.com/doc/8816364637.html,ing this approach,there is no need for the programmer to learn two distinct languages.Learning the programming language is su?cient.

Typing

Similar to the discussion on encapsulation,we?nd that explicit typing is good for embedded queries,but bad for ad hoc queries.Explicitly typing embedded queries improves the correctness of a program.For an interactive user however,correctness is not quite as big an issue.Since the type can be inferred from the structure/class,we do not need to declare an explicit type with the query.This will increase the clarity and ease the creation of new,ad hoc queries.

2.2RELOOP

The Altair research group in Rocquencourt,France,is currently implementing O2[CDLR89],an object-oriented database management system(OODBMS).O2supports two languages,each one adding data description and data manipulation to an existing programming language.These pro-gramming languages,when coupled with the database management facilities,solve the traditional impedance mismatch problem.However,they do not provide a very nice way in which to query a database.

Therefore,to compete with relational systems,the Altair group is implementing RELOOP,an interactive query language designed to allow users to specify reasonable queries easily and concisely.

RELOOP is being implemented on top of the O2OODBMS.O2supports all of the standard object-oriented features.Its support of complex objects is in the form of providing three minimal set constructors:sets,lists and tuples.All of these constructors can be applied to each other. For example,the user can create sets of sets,tuples with set valued?elds,etc.O2also has one additional distinctive feature–its values.Values di?er from objects in the following ways[BCD89]:?Values do not obey object-oriented principles.

?Their structures are very similar to objects,but they are visible to the user whereas objects are encapsulated.

?Values have no identity.

?Values are manipulated by operators,not by methods.

For instance,the‘.’operator allows for the extraction of a?eld from its tuple,like in SQL. Iteration is possible over a set value,and two list values can be concatenated.

A Sample O2Database Schema

6Culik,Mack and Shewchun Person=[name:[f-name:String,l-name:String],

age:Integer,

address:[city:String,zipcode:Integer]]

Woman=[name:[f-name:String,l-name:String],

age:Integer,

sex:String,

address:[city:String,zipcode:Integer]]

Woman is a subclass of person.

Man=[name:[f-name:String,l-name:String],

age:Integer,

sex:String,

address:[city:String,zipcode:Integer]]

Man is a subclass of person.

Family=[name:String,

mother:Woman,

father:Man,

children:{Person}]

All the?elds of the above classes can be accessed through methods such as the following.

name:Person?[?rst-name:String,last-name:String]

address:Person?[city:String,zipcode:String]

age:Person?Integer

is-child-of:Person×Person?Boolean

spouse:Woman?Man

spouse:Man?Woman

name:Family?String

mother:Family?Woman

father:Family?Man

children:Family?{Person}

Note that these methods allow complete access to all data;thus,there is no reason to violate encapsulation.

The following is a presentation of the features of the RELOOP language[CDLR89].All example queries access a sample database implemented on the above de?ned database schema.

2.2.1Syntax

Since most potential users of the query language know SQL,the designers of RELOOP decided to make the language SQL-like.Consequently,RELOOP queries will feature the select from where block.

SQL Extensions and Algebras for OODBMS7 We begin with a simple query illustrating the syntactical di?erences between RELOOP and SQL.

Q1:What are the names of the minors?

select name(p)

from p in Person

where age(p)<18

Basically,the query can be read and understood much like an SQL query.The select clause de?nes the result(the names of some persons).The from clause says where to get the information. Note that in this case,“Person”is a special set value,so it is legal to de?ne the variable p as ranging over the set and representing one of its elements.The where clause speci?es the conditions that must be satis?ed.

The?rst obvious di?erence from SQL is the speci?cation of“name(p)”instead of“https://www.doczj.com/doc/8816364637.html,”in the select clause.The designers believe that the functional notation is easier to read.Another advantage of this notation is that it is used both for operators and methods,so inexperienced users do not need to understand the di?erence between objects and values.

For instance,to get the?rst name of a person,we?rst have to apply the“name”method on a “Person”object,and then use the?eld extract operator to obtain the result.Clearly,the expression ?rst-name(name(p))is easier to read and use than the expression name(p).?rst-name.

Second,RELOOP introduces a new keyword,“in”in the from clause.Any expression which results in a set value can be used in the from clause.Therefore,in the case of complex expressions, a separator between the variable name and its domain makes the query easier to read.

Finally,a select from where block result will always be a set value.This results from the fact that users are usually trying to retrieve a collection of database entities.However,if the user knows that they are extracting a single item from the database,they may use the RELOOP operator“extract”to get the unique item in a set.

2.2.2Accessing Nested Structures

The following query shows how to access data in a nested structure.

Q2:Find the Families where the husband lives in Waterloo.

select f

from f in Family

where city(address(husband(f)))=”Waterloo”

The expression in the where clause can be seen as a path within the object composition hierarchy.For each family,we apply to it the husband method which returns a Man object.We then apply the address method to the Man object,and then?nally the city operator to extract the city?eld from the address.We can access any data in the database using some such expression. The result of the query is a set of database objects.The next section will illustrate how the user can create new entities in the select clause.

8Culik,Mack and Shewchun

2.2.3Constructing New Entities

The following query shows how to construct tuple values.

Q3:Find the?rst name and age of the minors.

select[name:f-name(name(p)),age:age(p)]

from p in Person

where age(p)<18

The tuple operator[]allows the construction of tuple values.It takes as arguments?eld names and their descriptions.A description can be made through any valid RELOOP expression. Therefore,as we will see later,this feature allows us to build nested structures.

As mentioned earlier,the result of a query is always a set value.Therefore,since the above select clause constructs tuples,the?nal answer to the query will be of the following type:{[name: String,age:Integer]}

2.2.4Nested Structures

In this section we will illustrate both how to create nested structures and how to?atten nested ones.

The?rst query shows how to construct a?at structure from a nested one.

Q4:Find the mother of every child.

select[child:child,mother:mother(f)]

from f in Family

child in children(f)

An interesting observation is that it is valid to de?ne a variable domain in the from clause through the application of a method on a previously de?ned variable.In fact,any RELOOP expression which returns a set value can be used for this purpose.This feature allows the user access to all levels of a nested structure,and thus,allows easy unnesting.

The last two queries show,conversely,how to build nested structures from?at ones.

Q5:Associate with each woman her minor children’s?rst names,

assuming that a woman may appear in di?erent families.

make-method minors(woman:mom)

select f-name(name(child))

from f in Family

child in children(f)

where age(child)<18and

mother(f)=mom

select[mother:mom,children:minors(mom)]

from mom in Woman

SQL Extensions and Algebras for OODBMS9 The sets of minor children that we wish to construct are not database entities,therefore,they must be constructed.One way in which we can accomplish this is to create a method on the Woman class which will collect the appropriate set of children.The above method examines every child in every family and picks those that are under18years of age and whose mother is the method’s argument.Once the method is complete,we only need to build a simple query that creates a tuple result from which we call the method.Therefore,the type of the?nal result is{[mother:Woman, children:{String}]}

In this example,the nesting was done on an object.However,often we work with values instead of objects.Since we cannot use methods on values,we must?nd another way of formulating the above query.

The following is an alternate RELOOP expression for the above query which can deal with both objects and values.

select[mother:mom,children:

select f-name(name(child))

from f in Family

child in children(f)

where age(child)<18and

mother(f)=mom]

from mom in Woman

The only di?erence between the two formulations is that in the latter we?nd the body of the method where the method was previously called.It is unclear from the literature written on RELOOP whether recursive calls to methods are permitted.

2.2.5Some Additional RELOOP Facilities

We conclude our discussion of RELOOP by introducing two of the language’s facilities,the collapse operator,and the set constructor.The collapse operator?attens a set of sets.

For example,collapse({{1,2},{2,3}})={1,2,3}

The set constructor{}builds a set value from its arguments.

The following two queries illustrate the uses of these facilities.

Q6:Find the people that have at least one child.

select mother(f)

from f in Family

where children(f)={}

union

select father(f)

from f in Family

where children(f)={}

This query?rst?nds all the women and then all the men that have at least one child,and then it merges the results.The union of the results is possible because women and men are both persons.

10Culik,Mack and Shewchun Using the collapse operator,we can also use a di?erent query formulation to obtain the same result.

collapse(select{mother(f),father(f)}

from f in Family

where children(f)={})

In this query,for each family with more than one child,a set containing a mother and a father is constructed.Therefore,the result of this query is a set of sets.The collapse operator?attens the result into just one set.

An interesting observation is that this query does not use an instruction such as“distinct”to avoid duplicate values.This is because of the fact that we are manipulating sets in the select clause,and thus duplicates(and order)have no meaning.

2.2.6Aggregate Operators

Aggregate operators,like those we are familiar with in SQL

(sum,avg,...),are not yet implemented,but will be available in the?nal version of RELOOP.

2.3OSQL

Hewlett-Packard Laboratories are currently developing the Iris[FAC+89]object-oriented database management system(OODBMS).Iris is a research prototype of a next generation DBMS,intended to meet the needs of new and emerging applications.

Currently,one of the three interactive interfaces that is provided by Iris is Object SQL(OSQL) [FAC+89].OSQL is an object-oriented extension of SQL.

A Sample OSQL Database Schema

Person=(?rst-name Charstring required,

last-name Charstring required,

age Integer,

city Charstring),

Employee=(?rst-name Charstring required,

last-name Charstring required,

age Integer,

city Charstring,

company Charstring,

salary Integer),

Employee is a subclass of person.

All the?elds in the above classes can be accessed through property functions such as the following.

SQL Extensions and Algebras for OODBMS11?rst-name:Person?Charstring

last-name:Person?Charstring

age:Person?Integer

city:Person?Charstring

company:Employee?Charstring

salary:Employee?Integer

Note that the above property functions allow complete access to all data;thus,there is no reason to violate encapsulation.

The following is a presentation of the features provided by OSQL[FAC+89].Example queries access a sample database implemented on the above database schema.

2.3.1Syntax

OSQL basically adheres to the SQL query format,but its syntax di?ers more from SQL than that of RELOOP.For example,consider the following simple query:

Q1:What are the?rst names of the minors?

Select distinct?rst-name(p)

for each Person p

where age(p)<18;

An obvious di?erence is that the from keyword has been replaced by for each.

We will see further di?erences in OSQL syntax in subsequent sections,especially shortcuts we can make in a query formulation when calling functions from the query.

OSQL does provide SQL’s“distinct”operator which eliminates duplicates,while RELOOP does not.(RELOOP select statements automatically eliminate duplicates).

2.3.2Referencing Objects Through Keys

Objects may be referenced directly rather than indirectly,through their keys.Interface variables may be bound to objects on creation or retrieval and may then be used to refer to the objects in subsequent statements.

The following OSQL expression creates an instance of the person object.

Create Person(?rst-name,last-name,age,city)instance

p1(John,Doe,25,Waterloo);

Q2:Find the age of the person with identi?er p1.

Select age(p1);

First we create a new person and then give this person the unique identi?er p1.We can then use the identi?er when we want to refer to its object as in the above select clause.

Notice that no such feature is provided in RELOOP.

12Culik,Mack and Shewchun

2.3.3Using Functions in Queries

User-de?ned functions and Iris system functions may appear in where and select clauses to give concise and powerful retrieval.

For example,let us de?ne the function Marriage as,

Create function Marriage(Person p)?

forward;

(forward speci?es that the function implementation will be speci?ed later.)

This function returns a compound result–the spouse and the date of the marriage.

We have already seen the use of a function in the select clause in the previous section.The following example shows how a function is invoked in the where clause.

Q3:Find Bob’s wife and the date on which they where married.

Select s,d

for each Person s,Charstring d

where=Marriage(Bob);

Here we are comparing every combination of a Person object and a character string to the result of the Marriage function when applied to the Person Object“Bob”.Note that the above example demonstrates that OSQL permits queries to range over in?nite domains.

The above query can be abbreviated to:

Select each Person s,Charstring d

where=Marriage(Bob);

Or even more simply to:

Select Marriage(Bob);

The last two query formulations stray from the SQL select from where block.The?rst abbreviation combines the two keyword phrases Select and for each into one“Select each”phrase.The second abbreviation does not explicitly specify the type of its result,but implies that it will be of the form of the result of the Marriage function.

Notice that these types of syntactical shortcuts are not possible in RELOOP.

2.3.4Accessing Nested Data

As in RELOOP,the expression in the where clause can be seen as a path within the object composition hierarchy.All data in the database can be accessed using an expression such as the following:

Q4:Find all families where the husband lives in Waterloo.

Select f

for each Family f

where city(husband(f))=“Waterloo”

SQL Extensions and Algebras for OODBMS13

2.3.5Aggregate Functions

Several aggregate functions have already been implemented in OSQL.In previous sections we saw functions de?ned on individual objects.There is also a need for functions over multi-sets(sets containing duplicates).

The following query illustrates the use of the function“average”.

Q5:Find the average salary of all employees.

Select y

for each Real y

where y=Average(select Salary(x)for each Employee x);

The nested select function returns a mult-set of values which is used as input to the Average function.

Iris semantics are such that nested select statements and function calls are equivalent in re-trievals.Thus,given a function,EmpSal(),that returns the salaries of all employees,the above query could be rewritten by replacing the nested select statement with a call to Empsal.

As mentioned earlier,aggregate operators have not yet been implemented in RELOOP but will be available in the?nal version.It will be interesting to see how a query such as the above will be implemented since the RELOOP select statement eliminates duplicates.

3Algebras for Object-oriented Database Systems

One of the strong points for the relational database model is the existence of a formal algebra for query processing and optimization.Attempts are now being made to develop a similar algebra for object-oriented database systems.This section will examine four such algebras:an algebra for the EXTRA DDL and EXCESS DML[VD91],an algebra for the ENCORE data model[SZ],an algebra for RELOOP[CDLR89],and OOAlgebra,an algebra for OODAPLEX[Day].

3.1An Algebra for EXTRA/EXCESS

3.1.1The EXTRA Data Model

In the EXTRA data model[VD91]complex objects are de?ned as complex structures.These structures are built from tuple,multiset,and array type constructors.Multisets are sets with duplicates.Arrays are one-dimensional only,and of variable length.Methods can also be de?ned for a structure as a sequence of EXCESS statements.Object identity is supported with the ref keyword which speci?es a reference to an extant object(ie:an OID).In this way,ref can actually be viewed as another type constructor.Inheritance is handled by allowing one structure to inherit another, which causes all attributes and methods of the structure being inherited to become attributes and methods in the new structure.Any inherited attribute or method can be overridden in the new structure de?nition.Multiple inheritance is also allowed.

14Culik,Mack and Shewchun

3.1.2The EXCESS Query Language

The EXCESS query language allows for both querying and updating of the database.Any structure de?ned in EXTRA can be fully manipulated by EXCESS.EXCESS can also be extended with user-de?ned functions and operators written in the E language.

As an example,consider the following EXCESS query which?nds the names of the children of all employees who work for a department on the second?oor.

range of E is Employees

retrieve(https://www.doczj.com/doc/8816364637.html,)from C in E.kids

where E.dept.floor=2

Here,Employees has been created in EXTRA to be a set of Employee structures(objects). The“.”notation is used to access the properties of a complex structure.

3.1.3The Algebra

The EXCESS/EXTRA algebra is formally de?ned as a set of n-ary operators that operate on a set of objects,and are closed with respect to this set of objects.Elements of this set of objects are called“structures”.A structure contains two components,a schema and an instance.A schema is a digraph with the nodes representing one of the four type constructors(multisets,tuples,arrays, or refs)or a simple scalar value,and the edges representing a“component of”relationship.So, a schema is just a digraph representation of a structure de?ned in the EXESS DDL.Since the algebra operates on di?erent“sorts”(di?erent type constructors),it is referred to as a“multi-sorted”algebra.

3.1.4Operators

The EXTRA/EXCESS algebra contains a large number of operators to handle the various features of the EXCESS query language.Instead of having all operators work on sets,as is done in many algebras,di?erent operators are de?ned for each of the four“sorts”within the algebra.

Multiset Operators

There are eight operators for multisets:

1.Additive Union:Combines two multisets and does not eliminate duplicates.

2.Set Creation:Creates a new multiset with a single member.

3.Set Apply:Apply an algebraic expression to all members of the multiset,replacing them

with the result of the expression.

4.Grouping:Partition a multiset based an algebraic expression.

5.Duplicate Elimination:Convert a multiset to a regular set.

6.Di?erence:Subtract the cardinality of set members to determine the result cardinality.

7.Cartesian Product:The regular set-theory Cartesian product.

SQL Extensions and Algebras for OODBMS15

8.Set Collapse:Takes a multiset of multisets and returns the union of the member multisets. Tuple Operators

There are four operators for tuples:

1.Projection:The same as the relational projection except it works only on a single tuple.

2.Concatenation:Concatenates two tuples.

3.Field Extraction:Extracts a single?eld from a tuple.Unlike projection,the result is the

?eld,not a1-tuple.

4.Creation:Create a new1-tuple.

Array Operators

There are nine operators for tuples:

1.Creation:Create a single element array.

2.Array Extract:Extract a single element from an array.

3.Subarray:Extract a range of elements from an array and place them in a new array.

4.Array Concatenation

5.Array Apply

6.Array Collapse

7.Array Di?erence

8.Duplicate Elimination

9.Cartesian Product

The last six operators are the same as the corresponding set operators except that they preserve order.

OID Operators

Recall that EXTRA/EXCESS OIDs are just references to objects which exist in the database independent of the objects which reference them.There are two operators for OIDs:

1.Dereference:Dereference an OID node within a schema.The OID node is replaced by what

it referenced.

2.Reference:This operator creates an OID for its operand and then inserts this new OID into

a schema.

Predicates

There is one additional operator within the algebra to handle predicates called COMP.A predicate is speci?ed with the COMP operator and it returns its input exactly if the predicate is true,or nothing if the predicate is false.Predicates may only appear in this COMP operator.

16Culik,Mack and Shewchun

retrieve(TopTen[5].name,TopTen[5].salary)

πname,salary(DEREF(ARR EXT RACT5(T opT en)))

Figure1:EXCESS Query and Algebraic Representation

3.1.5Examples

The EXTRA/EXCESS algebra will now be illustrated with two examples.For these examples a database is being used that contains a set of Student objects named Students,a set of De-partment objects named Departments,a set of Employee objects named Employees,and a ?xed length array of size ten of Employee objects called TopTen.All of these sets and the array contain references to objects,rather than the objects themselves.The Student,Employee,and Department objects are all tuples.

Figure1shows the?rst example.It contains an EXCESS query that returns the name and salary of the5th element of the TopTen array.Bellow the query is the corresponding algebraic representation.

In this example ARR EXTRACT is the array extract array operator,DEREF is the deref-erence OID operator,andπis the projection tuple operator.This expression extracts the5th element of the TopTen array with the array extract operator,dereferences it to obtain the actual Employee tuple,and then uses projection to obtain the name and salary.

Figure2gives a second example.Here the query retrieves the names of the departments of all employees who work in Madison.To simplify the presentation of the algebraic representation,a graphical notation is used.In this notation an arc from A to B is used in place of B(A).

In this example SET APPLY has been abbreviated as S A,and

TUP EXTRACT is the tuple extract tuple operator.The?rst expression in this example(bottom most)converts the multiset of Employee references to a multiset of actual bf Employee tuples.The second expression selects all tuples such that the employee works in Madison.The third expression dereferences the“dept”attribute of the employee tuples and replaces it with the actual“dept”value.The?nal expression preforms a projection on the“name”attribute to obtain the desired result(department names).

3.2An Algebra for ENCORE

3.2.1The ENCORE Data Model

A type in ENCORE[SZ]is an abstract data type.Each type has a name(which is used for type equivalence),a set of properties,and a set of operations.Operations are functions that can be applied to instances of the type.A property is a typed object that can be implemented as an actual value,or as a procedure or function that returns an object of the correct type.

Multiple inheritance is supported by allowing the speci?cation of a set of supertypes in the de?nition of a type.A type inherits all of the properties and operations of its supertypes.Properties

SQL Extensions and Algebras for OODBMS17 retrieve(https://www.doczj.com/doc/8816364637.html,)

where Employees.city=”Madison”

S Aπ

name(INP UT)

S A DEREF(T UP EXT RACT

dept(INP UT))

S A COMP

(INP UT)

T UP EXT RACT city(INP UT)=“Madison

S A DEREF(INP UT)

Employees

Figure2:EXCESS Query and Algebraic Representation

cannot be overridden in inheritance.However,operators can be overridden as long as the operator for the new type has the same argument and output types as the operator from the superclass.All types in encore are subtypes of the type Type.

ECORE also supports parameterized types,with the tuple and set parameterized types built in.

The objects in ENCORE are simply instances of the type Object or subtypes of the type Object.Type Object de?nes some basic operations for objects,such as comparison and type of. All objects in ENCORE have a unique identity.

It should be noted that sets and tuples are objects within ENCORE since they are instances of the set and tuple parameterized types.The set and tuple types are subtypes of the top level type Object.

3.2.2Operators

The ENCORE algebra has three groups of operators,the basic operators,the set operators,and the object identity operators.Unlike EXTRA/EXCESS all of the operators in ENCORE operate on collections of objects.Also,while there are twelve operators in total,the group of four basic operators are the main ones that would be handled by the query optimizer,compared to the large number that the optimizer for EXTRA/EXCESS must deal with.

The group of identity operators in ENCORE is of special note.Queries in ENCORE may produce new objects that did not previously appear in the database.These objects will have their own unique object identities.It is possible that a new group of objects could be created when only a single object is needed.That is,the objects have di?erent identities but are shallow equal. To handle this,the concept of i-equality is introduced,where i indicates how“deep”a comparison

18Culik,Mack and Shewchun should be made.The identity operators make use of this i-equality.

The Basic Operators

There are four basic operators de?ned in the algebra.For the following de?nitions,S and R are collections of objects,p is a?rst-order Boolean predicate,the A i are attribute names having type T i,and the f i are functions returning objects of type T i.

1.Select(S,p)={s|(s in S)∧p(s)}

Select takes a set of objects and returns only those that satisfy the predicate.

2.Image(S,f)={f(s)|s in S}

Image is similar to the apply operators of EXTRA/EXCESS.It applies a function to each object in the given collection.

3.P roject(S,<(A1,f1),...,(A n,f n)>)=

{|s in S}

Project is an extension of Image and allows more than one function to be applied to the objects.For each object in S a tuple is returned which contains the result of applying each of the functions(f i)to the object.Note that this operator actually generates new objects (tuples)that become part of the database.

4.Ojoin(S,R,A,B,p)={|s in S∧r in R∧p(s,r)}

Ojoin is used to create new relationships in the database.For each pair(s,r)where s is in the collection of objects S and r is in the collection of objects R,it returns a tuple containing s and r if they satisfy the speci?ed predicate.In other words,it generates a set of tuples containing two objects that have a particular relationship.As with Project these tuples are new objects that become part of the database.

Set Operators

The algebra contains the following set operators:

1.Union,Di?erence,Intersection

These are the standard set operators where set membership is determined by object identity.

2.Flatten

This operator takes an object that is of type set of sets and returns an object that is of type set.

3.Nest,UnNest

These operators perform nesting and unnesting of tuples on a single attribute.This is best illustrated with an example.The UnNest operator on B on the set{}, where s1is a a set containing o1and o2,would produce the set of tuples{ ,}.The Nest operator is essentially the inverse operation.

SQL Extensions and Algebras for OODBMS19 Identity Operators

The algebra contains two identity operators:

1.DupEliminate(S,i)

This operator keeps only one copy of i-equal objects from a collection of objects.

2.Coalesce(S,A k,i)

For a collection of tuple objects,this operator eliminates i-equal duplication in the A k com-ponents(attributes)of the tuples.

3.3An Algebra for RELOOP

3.3.1RELOOP

Since the RELOOP query language has already been discussed in this paper,no further mention of it will be made here.Instead,the reader is directed to the appropriate sections earlier in this paper.

3.3.2The O2Data Model

The O2data model[CDLR89]consists of a set of classes.Associated with each class is a type expression.A type expression is recursively de?ned and contains atomic type expressions(integer, real,etc),class names,tuple type expressions,and set type expressions.Note that a class name can appear in a type expression,and this is how inheritance is achieved.

An object in O2is a value corresponding to some type expression(class).Associated with each object is a unique object identi?er.For each class,there is an assignment function that returns the set of object identi?ers for the objects that are members of that class.

O2also allows for the de?nition of methods.

3.3.3Algebra Operators

There are only a small number of operators in the RELOOP algebra,and all of these operate on sets of tuples(relations).As with OOAlgebra(described in a later section),most of these operators are the same as those found in the relational algebra.The operators are presented formally below. In the following a i is an attribute name,v i is a value,and r or r i is a relation(set of tuples).

1.Set Operators

The algebra supports the standard set operators union,intersection,and di?erence.

2.Projection

The projection operator in the RELOOP algebra is the same as that in the relational algebra.

It removes all but a speci?ed set of attributes from all tuples in a set.

20Culik,Mack and Shewchun

3.Selection

The selection operator is similar to that from relational algebra.Given a boolean predicate and a set of tuples,it returns the set of tuples for which the predicate is true.The predicate expression has as its argument a set of tuple values,and has the form E1θE2,where E1and E2are expressions andθis one of the traditional comparators.Note that a predicate cannot use the boolean operators.

4.Cartesian Product

The Cartesian product operator is similar to that from relational algebra,but behaves slightly di?erently.A list of attribute names must be given,along with a corresponding list of sets of tuples.The result is a set of tuples containing the cross product of the tuples from the given sets,using the given attribute names.Formally this is speci?ed as:

?(r1,...,r n)=

{[a1:v1,...,a n:v n]|?i∈[1,n],(v i∈r i)}

5.Reduction

The reduction operator is used to remove the values from tuples,discarding the attribute names.The result of the reduction operator on a set of tuples is the set of values from the tuples.Formally this is:

(r)={v|[a:v]∈r}

3.3.4Example

To illustrate the RELOOP algebra an example will now be given.For this example a database with the following properties is used:

?Person={i1,i2,i3}where i1,i2,i3are object identi?ers.

?age(i1)=2,age(i2)=18and age(i3)=19

??rst-name(name(i1))=“John”,

?rst-name(name(i2))=“Joan”,and

?rst-name(name(i3))=“Jack”.

?last-name(name(i1))=“Doe”,

last-name(name(i2))=“Doe”,and

last-name(name(i3))=“Smith”.

Figure3gives a query to?nd the?rst name and age of all of the adults in the database described above.Below the query is the corresponding algebraic representation.

The?rst expression in this example will produce the set of all possible tuples with the type {[p:Person,name:String,age:Integer]}.The second expression is a selection operation on the given condition and will produce the following tuples:

{[p:i2,name:Joan,age:18],[p:i3,name:Jack,age:19]}

The?nal expression is a projection on name and age and will produce:

{[name:Joan,age:18],[name:Jack,age:19]}

中国电信集团员工培训课程体系(272页)

中国电信集团员工培训课程体系 前言 人才资源是企业最重要的战略资源,人才的培养越来越成为企业的战略举措之一。中国电信集团公司组建以来对员工培训工作给予了高度重视,将教育培训创新作为五项机制创新的重要组成部分大力推进实施。二年来,集团公司围绕培训体系建设先后开展了内聘培训师队伍建设、培训课程体系研究、培训效果评估体系研究、电子学习系统建设、培训教材和电子学习课件开发等工作,并出台了相关指导意见和管理办法,为集团人力资源开发和人才的培养提供了有力支撑。 为使员工培训工作与企业发展及员工职业发展紧密结合,加强员工培训工作的针对性、计划性和系统性,促进员工岗位成才,集团公司与信息产业部电信科学研究院合作进行了员工培训课程体系的项目研究并制定了《中国电信集团员工培训课程体系管理办法》。 本手册包括了《中国电信集团员工培训课程体系管理办法》和员工培训课程体系及实施方案两部分。员工培训课程体系及实施方案主要内容包括:中国电信集团员工培训需求分析,培训课程体系设计,培训课程的具体培训内容、培训形式、培训时间和适用对象描述。 本手册用于指导各级电信企业管理人员和人力资源部门开展员工培训工作,各单位可根据管理办法对具体岗位的培训课程内容进行适当调整和细化,以适应企业改革与发展的需要。 需要明确的是,培训课程体系不是一成不变的,其内容应该随着电信技术业务的发展、市场竞争形势的变化、企业流程及岗位设置的调整不断做出相应改进和完善。 在培训课程体系的项目研究过程中,得到了集团培训中心、浙江、广东、甘肃等省电信公司与集团公司各部门的大力支持,在此表示衷心的感谢。 二OO四年元月三十日

目录 第一部分《中国电信集团员工培训课程体系管理办法》 (15) 第二部分员工培训课程体系及实施方案 (21) 一、中国电信集团培训需求分析 (19) 1.企业状况分析 (19) 1.1企业发展目标和战略分析 (19) 1.2人力资源需求分析 (19) 2.工作状况分析 (20) 2.1岗位工作职责 (20) 2.1.1前端岗位 (20) 2.1.1.1集团公司 (21) 2.1.1.2省公司 (22) 2.1.1.3地市分公司 (23) 2.1.2后端岗位 (24) 2.1.2.1运行维护管理岗位 (25) 2.1.2.2网络建设管理岗位 (25) 2.1.2.3交换运行维护岗位 (25) 2.1.2.4传输运行维护岗位 (25) 2.1.2.5网管中心 (26) 2.1.2.6计算机维护中心 (26) 2.1.2.7数据中心 (27) 2.1.2.8动力中心 (27) 2.1.2.9线路中心 (27) 2.1.3管控支撑岗位 (28) 2.1.3.1领导岗位 (28) 2.1.3.2部门管理岗位 (29) 2.2岗位任职资格 (30) 2.2.1前端岗位 (30) 2.2.1.1集团公司 (30) 2.2.1.2省公司 (31) 2.2.1.3地市分公司 (31) 2.2.2后端岗位 (32) 2.2.2.1集团公司 (32) 2.2.2.2省公司 (32) 2.2.2.3地市分公司 (32) 2.2.3管控支撑岗位 (32) 2.2.3.1领导岗位 (32) 2.2.3.2部门管理岗位 (33) 3.员工状况分析 (33) 3.1员工现状 (33) 3.2差距分析 (34) 4.培训现状及培训需求 (35)

SQL中的case-when,if-else实例

create database EXAM go create table student (stuName varchar(10)not null, stuNO int primary key not null, stuSex char(2)check(stuSex='男'or stuSex='女'), stuAge int, stuSeat int, stuAddress varchar(40) ) GO insert into student values('张秋丽','25301','女','21','1','北京海淀'), ('李文才','25302','男','25','2','天津'), ('张三','25303','男','22','3','北京海淀'), ('红尘','25304','女','21','4','湖南长沙'), ('段林希','25305','女','20','5','江西赣州'), ('魏晨','25306','男','23','6','河北石家庄'), ('郑爽','25307','女','20','7',''), ('张杰','25308','男','21','8',''), ('王洁','25309','女','23','9','湖南怀化'), ('刘欣','253010','女','21','10','北京') create table exam (ExamNO int primary key, stuNO int not null, WrittenExam int, LabExam int ) GO insert into exam values(01,250301,86,89), (02,250302,67,78), (03,250303,76,80), (04,250304,79,56), (05,250305,56,63), (06,250306,67,60), (07,250307,90,83), (08,250308,80,79), (09,250309,92,90), (10,250310,55,58)

电信内部培训资料

这资料是电信部培训资料,所以在说明如排障以前先普及一些有关电信的知识,如需直接查询故障请看二楼~~ 一、宽带知识 DNS介绍 域名是Internet上某一台计算机或计算机组的名称,用于在数据传输时标识计算机的电子位(有时也指地理位置)。域名是由一串用点分隔的名字组成的,通常包含组织名,而且始终包括两到三个字母的后缀,以指明组织的类型或该域所在的或地区。 把域名翻译成IP地址的软件称为域名系统,即Domain Name System,简称DNS。它是一种管理名字的法。这种法是:分不同的组来负责各子系统的名字。系统中的每一层叫做一个域,每个域用一个点分开。所谓域名服务器(即Domain Name Server,简称Name Server)实际上就是装有域名系统的主机。它是一种能够实现名字解析 (name resolution)的分层结构数据库。 在域名小写是没有区分的,域名在整个Internet中是唯一的,当高级子域名相同时,低级子域名不允重复,一台服务器只能有一个IP地址,但是却可以有多个域名,所以国服务器多数主机是共用IP。 域名有哪些类型? . ---商业公司 .mil ---军事领域 .info---提供信息的机构; .org ---组织、协会等 .arts---艺术机构 .store--商业销售机构 .net ---网络服务 .firm---商业公司 .web ---与WWW相关的机构。 .edu ---教育机构 .nom ---个人或个体 .gov ---政府部门 .rec ---消遣机构 随着Internet向全世界的发展,除了edu、gov、mil一般只在美国专用外,另外三个大类com、org、net则成为全世界通用,因此这三大类域名通常称为国际域名。由于国际域名资源有限,各个、地区在域名最后加上了标识段,由此形成了各个、地区自己的国域名。 国别的最高层域名:. ---中国,.au ---澳大利亚,.jp ---日本等,而美国因其特殊性,没有国别域名。 通常,我们又有国域名和国际域名的说法。其区别在于域名后面是否加有:“CN” 设置DNS的步骤 1)鼠标右键点击“网上邻居”,左键点“属性”项;

中国电信现场综合化维护培训教材-基础知识篇

中国电信 现场综合化维护培训教材 基础知识篇 (V1.0)

目录 第1章现场综合化维护简介 (1) 1.1现场综合化维护基本范围及内容 (1) 1.2通信网构成要素及拓朴结构 (2) 1.3现场综合化维护专业区分 (3) 第2章有线接入相关基础知识 (6) 2.1接入网概念 (6) 2.2铜缆接入网认知 (7) 2.3光纤接入网认知 (8) 第3章通信线路相关基础知识 (12) 3.1通信线路概述 (12) 3.2电缆线路认知 (12) 3.3光缆线路认知 (18) 3.4电缆线路设备认知 (24) 3.5光缆线路设备认知 (28) 3.6通信杆路认知 (32) 3.7通信管道认知 (34) 第4章无线通信相关基础知识 (37) 4.1移动通信概述 (37) 4.2基站收发信台认知 (39) 4.3天馈系统认知 (41) 4.4直放站认知 (43) 4.5室内分布系统认知 (44) 4.6 WLAN系统认知 (45) 第5章数据通信相关基础知识 (47) 5.1宽带IP网络认知 (47) 5.2 IP地址简介 (51) 5.3 VLAN概念简介 (52) 5.4 QINQ概念简介 (54) 第6章传输系统相关基础知识 (56) 6.1传输系统概述 (56) 6.2 SDH传输系统认知 (56) 6.3 DWDM传输系统认知 (58) 6.4 ASON传输系统认知 (60) 6.5 MSAP传输系统认知 (61) 6.6 IPRAN传输系统认知 (62) 第7章交换系统相关基础知识 (64) 7.1程控交换机认知 (64) 7.2交换远端模块认知 (64) 7.3接入网关(AG)认知 (65)

项目开发中常用到的SQL语句

项目开发中常用到的SQL语句1、循环示例 循环示例代码: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 DECLARE @i int DECLARE @name varchar(10) DECLARE @password varchar(10) Set @i = 1000 WHILE @i < 1200 BEGIN Set @i =@i +1 SET @name = RIGHT('0000' + CAST(@i AS varchar(10)),4) set @password = @name select @name insert into dbo.LocomotiveTeminalBase (li_ID,t_ID,lt_IDNumber,lt_MiM,lt_FuWQIP,lt_FuWQDKH,lt_CreatedBy) values('d82575c0-2d21-4c47-a406-7771d7d2c80a','fb5d9a7b-9cd6-4a55-9e90-881706eaf @name,@password,'192.168.1.187','2000','9015c234-e185-4e15-96c6-f53426dd6690') END 2、数据库缓存依赖中用到的SQL语句代码示例: ? 1 2 3 4 5 6 7 8 --查看状态 Select DATABASEpRoPERTYEX('soft_LocomotiveRM_DB','IsBrokerEnabled') --启用broker ALTER DATABASE soft_LocomotiveRM_DB SET NEW_BROKER WITH ROLLBACK IMMEDIATE ALTER DATABASE soft_LocomotiveRM_DB SET ENABLE_BROKER --添加用户

for循环的简介及break和continue的区别

for循环的简介及break和continue的区别 1.for循环 for循环是更加简洁的循环语句,大部分情况下,for循环可以代替while循环、do-while循环。 for循环的格式为: for( 初始语句 ; 执行条件 ; 增量) { 循环体 } 执行顺序:1、初始语句2、执行条件是否符合?3、循环体4、增加增量 初始化语句只在循环开始前执行一次,每次执行循环体时要先判断是否符合条件,如果循环条件还会true,则执行循环体,在执行迭代语句。 所以对于for循环,循环条件总比循环体多执行一次。 注意:for循环的循环体和迭代语句不在一起(while和do-while是在一起的)所以如果使用continue来结束本次循 环,迭代语句还有继续运行,而while和do-while的迭代部分是不运行的。 来个例子:输入一个数n(n>1),输出n!的值。n!(n的阶层)=1*2*3*……*n #include void main() { long num=1; int n,i; printf("请输入n:");

scanf("%d",&n); for(i=1;i<=n;i++) num=num*i; printf("%d的阶层是%d\n",n,num); } 2.break和continue的区别和作用 break和continue都是用来控制循环结构的,主要是停止循环。 1.break 有时候我们想在某种条件出现的时候终止循环而不是等到循环条件为false才终止。 这是我们可以使用break来完成。break用于完全结束一个循环,跳出循环体执行循环后面的语句。 2.continue continue和break有点类似,区别在于continue只是终止本次循环,接着还执行后面的循环,break则完全终止循环。 可以理解为continue是跳过当次循环中剩下的语句,执行下一次循环。 例子: #include void main() { int sum,i; sum=0; for(i=1;i<=100;i++) { sum=sum+i; if(i==2) {

电信CDMA培训考试-试卷(含答案)

网络优化试题 一 . 基础知识 1、填空题(每空0.5分,共25分) 1.无线信号在水面上传播比在空气中传播的损耗大(大/小),无线信号的频率越高,在空气中传播的损耗越大(大/小)。 2.和,均可用于表征无线信号质量的好坏,其中文名称为::误帧率_ :载干比_ :导频强度 3.当某一个导频的强度超过时,移动台会向基站发 送,并 且把该导频列入候选集。 4.系统用到的三种码是码_ ,码,长码。其中区分前向信道的是码。 5.系统的前向信道有_导频信道,同步信道,寻呼信道,前向业务信道。反向信道有接入信道,反向业务信道。 6.接口是和之间的接口, 接口是_ 和之间的接口。7.程控交换系统采用的信令方式是 .7。 8.参数是候选集与激活集的比较门限。 9.系统中的导频集有4种,是激活集,候选集,相邻集,剩余集。 10.系统的功率控制按上下行分为前向功率控制和反向功率控制,其中 _反向功率控制可以是开环功率控制。 11.系统软切换比例的含义(含切换的话务量-不含切换的话务量)/(含切换的话务量)×100%。软切换比例通常应在 35% 范围左右比较合适。 12.一般来说,手机最大发射功率是2,手机最大发射功率是0.1。 13.小区覆盖过大有几种原因,列出3种:导频功率过大,下倾角过小,天线太高 14.在规划中,若4,那么可用的有_128_个。 15.的搜索窗口设置的作用是补偿激活集多径延迟_。 16.的信令的中文意思导频测量消息 .

17.的信令的是反向功率控制中的信令. 是由发出的. 18.中的一个的时延是多少 0.244公里. 19.中的一个话务帧是多少_20_毫秒. 20.中 , 寻呼信道使用第 1-7 个码,导频信道使用第0_ 个码,同步信道使用第32_个码,话务信道使用 8-31 , 33-63 码 2、选择题(每题1.5分,多选题选错零分,共45分) 1.的勘测设计中,普通基站接地地阻的要求为( B )。 A、<1Ω B、<5Ω C、<10Ω 2.一个定向天线的增益是15, 也就是( D ),在计算系统增益 时数值应该是( D ); A. 11; B. 13; C. 15; D. 17; 3. 95系统使用的多址方式为。 A) B) C) D) 4.中的切换参数有那些.( 多选)、B、C A. ; ; B. ; C. ; ; 5.的激活集的导频数量: ( A ) A. 6 ; B. 8 ; C. 12 ; D 20 6.关于路测,以下说法错误的是:( B ) A. 路测前要进行路测仪器的检查。 B.路测终端天线的位置对路测结果影响不大。 C.车速对路测结果有一定影响。 D.路测路线的选择对路测结果有一定影响。 7.下列哪个参数集说明中的反向闭环功率控制? ( B ) A. B. C. D. 8.的中的接入参数有那些 ( 多选) 、B、C、D、E、F、G、H A. B. , C , D , E. , F. G. H. .

for循环语句的翻译

课程设计任务书 学生姓名:辛波专业班级:计算机0707班 指导教师:彭德巍工作单位:计算机科学与技术学院 题目: FOR循环语句的翻译程序设计(递归下降法、输出四元式) 初始条件: 理论:学完编译课程,掌握一种计算机高级语言的使用。 实践:计算机实验室提供计算机及软件环境。如果自己有计算机可以在其上进行设计。 要求完成的主要任务:(包括课程设计工作量及其技术要求,以及说明书撰写等具体要求) (1)写出符合给定的语法分析方法的文法及属性文法。 (2)完成题目要求的中间代码四元式的描述。 (3)写出给定的语法分析方法的思想,完成语法分析和语义分析程序设计。 (4)编制好分析程序后,设计若干用例,上机测试并通过所设计的分析程序。 (5)设计报告格式按附件要求书写。课程设计报告书正文的内容应包括: 1 系统描述(问题域描述); 2 文法及属性文法的描述; 3 语法分析方法描述及语法分析表设计; 4 按给定的题目给出中间代码形式的描述及中间代码序列的结构设计; 5 编译系统的概要设计; 6 详细的算法描述(流程图或伪代码); 7 软件的测试方法和测试结果; 8 研制报告(研制过程,本设计的评价、特点、不足、收获与体会等); 9 参考文献(按公开发表的规范书写)。 时间安排: 设计安排一周:周1、周2:完成系统分析及设计。 周3、周4:完成程序调试及测试。 周5:撰写课程设计报告。 设计验收安排:设计周的星期五第1节课开始到实验室进行上机验收。 设计报告书收取时间:设计周的次周星期一上午10点。 指导教师签名: 2010年 01月 08日 系主任(或责任教师)签名: 2010年 01月 08日

中国电信详解CDMA发展策略

中国电信详解CDMA发展策略

————————————————————————————————作者:————————————————————————————————日期:

(人民邮电报)中国电信详解CDMA发展策略 打造全新的高质量移动通信网 本报讯10月24日,中国电信在北京召开媒体恳谈会,集团公司15个大部门负责人向30余家媒体记者详细解答了公司CDMA发展策略,表示将充分发挥优势资源,加强内部协同,全力打造全新的高质量的移动通信网络。公司还将陆续推出“C+W”、CDMA 国际漫游等新业务,满足客户综合信息服务需求。 未来3年,中国电信计划投资800亿元用于升级、改造和优化CDMA网络,以加强网络信号覆盖;积极开展移动网络的建设和优化,同时强化CDMA网络在数据应用上的领先优势。目前,全国44个重点城市的网络优化已经开始,年底前将完成340多个城市的CDMA网络建设工作,满足82个无线城市的无线上网需求。在市场发展策略上,升级后的CDMA目标人群将聚焦于政企客户、家庭客户以及个人用户。公司开发的一大批新的移动业务也将陆续推出,这些业务既涵盖了三大客户群的不同应用需求,体现了差异化的服务内容。“C+W”业务融合了CDMA和WIFI两种技术手段,为客户提供随时随地的无线互联网接入服务,预计将于明年第一季度试商用。中国电信还平稳承接了原中国联通17个国家和地区的24家CDMA网络漫游伙伴关系,即将实施国际漫游新的转接合作。中国电信还将融合移动与固网的全业务优势,为用户提供真正意义上的互联网手机服务。 中国电信各部门负责人对CDMA发展充满信心,他们认为,中国电信拥有一支强大的网络运行维护队伍,在总部设立了网络优化中心,建立了最先进的网络优化平台,为落实CDMA网络优化目标奠定了基础。为迎接全业务经营,中国电信已集聚和培养了一大批高学历、高素质、有企业实践经验的专业人才,将加快收购CDMA网络后的企业文化融合,加大创新力度,与产业链各方开展多角度合作,面向各行各业以及家庭、

DB2常用SQL语句集

DB2常用SQL语句集 1、查看表结构: describe table tablename describe select * from tablename 2、列出系统数据库目录的内容: list database directory 3、查看数据库配置文件的内容: get database configuration for DBNAME 4、启动数据库: restart database DBNAME 5、关闭表的日志 alter table TBLNAME active not logged inially 6、重命名表 rename TBLNAME1 to TBLNAME2 7、取当前时间 select current time stamp from sysibm.sysdummy1 8、创建别名 create alias ALIASNAME for PRONAME(table、view、alias、nickname) 9、查询前几条记录 select * from TBLNAME fetch first N rows 10、联接数据库 db2 connect to DB user db2 using PWD 11、绑定存储过程命令 db2 bind BND.bnd 12、整理优化表 db2 reorgchk on table TBLNAME db2 reorg table TBLNAME db2 runstats on table TBNAME with distribution and indexes all 13、导出表 db2 export to TBL.txt of del select * from TBLNAME db2 export to TBL.ixf of ixf select * from TBLNAME 以指定分隔符‘|’下载数据: db2 "export to cmmcode.txt of del modified by coldel| select * from cmmcode”14、导入表 db2 import from TBL.txt of del insert into TBLNAME db2 import from TBL.txt of del commitcount 5000 insert into TBLNAME db2 import from TBL.ixf of ixf commitcount 5000 insert into TBLNAME db2 import from TBL.ixf of ixf commitcount 5000 insert_update into TBLNAME db2 import from TBL.ixf of ixf commitcount 5000 replace into TBLNAME db2 import from TBL.ixf of ixf commitcount 5000 create into TBLNAME (仅IXF) db2 import from TBL.ixf of ixf commitcount 5000 replace_create into TBLNAME (仅 IXF) 以指定分隔符“|”加载:

for循环实例

for循环实例 读取的是数组expr的行数,然后程序执行循环体(loopbody),所以expr有多少列,循环体就循环多少次。expr经常用捷径表达式的方式,即first:incr:last。 在for和end之间的语句我们称之为循环体。在for循环运转的过程中,它将被重复的执行。For循环结构函数如下: 1.在for循环开始之时,matlab产生了控制表达式。 2.第一次进入循环,程序把表达式的第一列赋值于循环变量index,然后执行循环体内的语句。 3.在循环体的语句被执行后,程序把表达式的下一列赋值于循环变量index,程序将再一次执行循环体语句。 4.只要在控制表达式中还有剩余的列,步骤3将会一遍一遍地重复执行。 10次。循环系数ii在第一次执行的时侯是1,第二次执行的时侯为2,依次类推,当最后一次执行时,循环指数为10。在第十次执行循环体之后,再也没有新的列赋值给控制表达式,程序将会执行end语句后面的第一句。注意在循环体最后一次执行后,循环系数将会一直为10。 环指数ii在第一次执行时为1,第二次执行时为3,依此类推,最后一次执行时为9。在第五次执行循环体之后,再也没有新的列赋值给控制表达式,程序将会执行end语句后面的第一句。注意循环体在最后一次执行后,循环系数将会一直为9。 循环指数ii在第一次执行时为1,第二次执行时为3,第三次执行时为7。循环指数在循环结束之后一直为7。

循环指数ii 在第一次执行时为行向量??????41,第二次执行时为??????54,第三次执行时为?? ????76。这个例子说明循环指数可以为向量。 例1 阶乘(factorial )函数 这种循环将会执行5次,ii 值按先后顺序依次为1,2,3,4,5。n_factorial 最终的计算结果为1ⅹ2ⅹ3ⅹ4ⅹ5=120。 例2 统计分析 执行如下算法: 输入一系列的测量数,计算它们的平均数和标准差。这些数可以是正数,负数或0。 答案: 这个程序必须能够读取大量数据,并能够计算出这些测量值的平均数和标准差。这些测量值可以是正数,负数或0。 因为我们再也不能用一个数来表示数据中止的标识了,我们要求用户给出输入值的个数,然后用for 循环读取所有数值。 下面的就是这个修定版本的程序。它允许各种输入值,请你自己验证下面5个输入值的

sql循环语句的写法

sql循环语句的写法 SQL循环语句 declare @i int set @i=1 while @i<30 begin insert into test (userid) values(@i) set @i=@i+1 end --------------- while 条件 begin 执行操作 set @i=@i+1 end WHILE 设置重复执行SQL 语句或语句块的条件。只要指定的条件为真,就重复执行语句。可以使用BREAK 和CONTINUE 关键字在循环内部控制WHILE 循环中语句的执行。语法WHILE Boolean_expression { sql_statement | statement_block } [ BREAK ] { sql_statement | statement_block } [ CONTINUE ] 参数

Boolean_expression 返回TRUE 或FALSE 的表达式。如果布尔表达式中含有SELECT 语句,必须用圆括号将SELECT 语句括起来。{sql_statement | statement_block} Transact-SQL 语句或用语句块定义的语句分组。若要定义语句块,请使用控制流关键字BEGIN 和END。BREAK 导致从最内层的WHILE 循环中退出。将执行出现在END 关键字后面的任何语句,END 关键字为循环结束标记。CONTINUE 使WHILE 循环重新开始执行,忽略CONTINUE 关键字后的任何语句。注释 如果嵌套了两个或多个WHILE 循环,内层的BREAK 将导致退出到下一个外层循环。首先运行内层循环结束之后的所有语句,然后下一个外层循环重新开始执行。示例 A. 在嵌套的IF...ELSE 和WHILE 中使用BREAK 和CONTINUE 在下例中,如果平均价格少于$30,WHILE 循环就将价格加倍,然后选择最高价。如果最高价少于或等于$50,WHILE 循环重新启动并再次将价格加倍。该循环不断地将价格加倍直到最高价格超过$50,然后退出WHILE 循环并打印一条消息。USE pubs GO WHILE (SELECT A VG(price) FROM titles) < $30 BEGIN

中国电信CDMA网络优化基础知识(一)

[在此处键入] CDMA网络优化基础知识

目录 1 网络优化的概念 (3) 1.1移动通信网络优化的概念 (3) 1.2无线网络优化的分类 (3) 1.3无线网络优化的内容 (3) 1.4无线网络优化与其他通信岗位的区别 (4) 1.5如何进入无线网络优化行业 (4) 1.6 CDMA技术的发展 (4) 1.7专业简介 (5) 2 基站天线基本原理 (7) 2.1 天线增益 (7) 2.2 辐射方向图 (7) 2.3 波瓣宽度 (8) 2.3.1 水平波瓣宽度 (8) 2.3.2 垂直波瓣宽度 (9) 2.4 工作频段 (9) 2.5 极化方式 (10) 2.6 下倾方式 (10) 2.7 天线的前后比 (11) 2.8 旁瓣抑制与零点填充 (11) 2.9 端口间隔离度 (12) 3 通讯基本概念介绍 (13) 3.1 系统带宽和信号带宽 (13) 3.1.1 系统带宽 (13) 3.1.2 信号带宽 (14) 3.2 爱尔兰的含义 (15) 3.3 阻塞率的含义 (16) 3.4 GOS (17) 3.5 接收机灵敏度 (17) 3.5.1 is-97灵敏度测试 (17) 3.5.2 链路预算中的接收灵敏度 (17) 3.6 反向负载因子 (17) 3.7 dB、dBm、dBi、dBd、dBc、dBW的含义 (18) 3.8 LAC (19)

3.9 频率复用 (19) 3.10 bit、Byte、symbol和chip的比较 (20) 3.11 CDMA系统常用频谱及频点计算 (21) 3.12 SID和NID的含义 (23) 3.13 IMSI字段的含义 (24) 3.14 本章学习要点 (25) 4 无线网络优化流程 (26) 4.1 基本流程介绍 (26) 4.2 需求分析 (28) 4.3 单站抽检 (28) 4.3.1 本阶段工作 (28) 4.3.2 案例介绍 (29) 4.4 优化前网络评估 (30) 4.5 基站簇优化 (31) 4.5.1 本阶段工作 (31) 4.5.2 案例介绍 (32) 4.6 全网优化及优化后网络评估 (35) 4.6.1 本阶段工作 (35) 4.6.2 案例介绍 (36) 4.7 项目验收和报告提交 (41) 4.8 本章学习要点 (41)

实验10 T-SQL语言编程基础

实验十 T-SQL语言编程基础 姓名:学号: 专业:网络工程班级: 同组人:无实验日期:2012-4-19【实验目的与要求】 1.熟练掌握变量的定义和赋值。 2.熟练掌握各种运算符。 3.熟练掌握流程控制语句,尤其是条件语句和循环语句。【实验内容与步骤】 10.1. 变量的定义与输出 1.变量的定义和赋值 1) 局部变量的声明: DECLARE @variable_name DataType 例如: declare @stuname varchar(20)--声明一个存放学员姓名的变量stuname. declare @stuseat int--声明一个存放学员座位号的变量stuseat 2) 局部变量的赋值: 局部变量的赋值有两种方法: a) 使用Set语句 Set @variable_name=value b) 使用Select语句 Select @variable_name=value 实验: 运行以下程序段,理解变量的使用。

--局部变量的赋值与使用 declare @customer_name varchar(20)--声明变量用来存放客户名称 set @ customer_name ='家电市场'--使用SET语句给变量赋值 select* from xss where客户名称=@customer_name --通过局部变理向sql语句传递数据 请给出运行结果: 练习: 创建一名为 Product_name的局部变量,并在SELECT语句中使用该变量查找“冰箱”的”价格”和”库存量”。 给出相应的语句 declare @Product_name varchar(20) set @Product_name ='冰箱' select价格,库存量 from CP where产品名称= @Product_name 请给出运行测试结果:

《For循环语句》

《F o r循环语句》教学设计 池州市第八中学杜亦麟 课题 2.4.1 For循环语句 教学内容 粤教版信息技术(选修1)《算法与程序设计》第二章《程序设计基础》第四节《程序的循环结构》第一小节《For循环语句》 教学目标 知识与能力: 1.理解循环结构的基本思想及For语句的执行过程。 2.培养和提高学生逻辑思维能力,使其可以独立完成简单循环结构算法的设计。 3.能够利用For循环语句实现循环结构,解决实际问题。 过程与方法: 1.通过简单的数学问题的分析、讲解,让学生掌握For循环语句语法知识,及其执行原理。 2.以任务驱动,学生分组合作探究的方式,进一步让学生理解For循环语句的基本思想,同时培养学生自主探究和合作学习的能力。 3.通过自评和互评活动,培养学生语言表达能力和归纳总结能力。 情感态度与价值观: 1.提高学生学习兴趣,培养学习的主动性和探究性。 2.培养学生团结协作精神,体验成功的快乐。 教学重点 1.掌握For循环语句的格式和功能; 2.理解For循环语句的执行过程。 教学难点 控制循环的条件、确定循环体的内容 教材分析 第二章是程序设计基础,也是全书的基础。它沿着分析问题、设计算法、编写程序等运用计算机解决问题之路,开始学习如何使用VB程序设计编写程序解决问题。本节课的主要内容For语句的基本格式、执行过程及语句的实际应用。又是本章的重点和难点内容。而循环结构是程序设计的三种基本结构之一,其作用是使一段程序反复执行。For循环语句在程序设计中频繁出现,也是三种结构中较难的一种,因此,学好本节课非常重要,本节课的学习会使学生对算法有一个更深刻的理解,为以后的程序设计打下一个良好的基础,也可以培养学生的创新能力、分析问题和解决问题的能力以及探究精神。

实验7_T-SQL语言编程基础[1]1

实验七T-SQL语言编程基础 【实验目的与要求】 1.熟练掌握变量的定义和赋值。 2.熟练掌握各种运算符。 3.熟练掌握流程控制语句,尤其是条件语句和循环语句。 【实验内容与步骤】 一、准备实验数据 CPXS数据库包含如下三个表: CP(产品编号,产品名称,价格,库存量); XSS(客户编号,客户名称,地区,负责人,电话); CPXSB(产品编号,客户编号,销售日期,数量,销售额); 三个表结构如图2.1~图2.3所示,请在企业管理器中完成表的创建。 图2.1CP表结构

图2.2XSS表结构 图2.3CPXSB表结构 2.1数据写入操作 在企业管理器中输入如图2.4~图2.6的CP表、XSS表和CPXSB表的样本数据。 图2.4CP表的样本数据

图2.5XSS表的样本数据 图2.6CPXSB表的样本数据 10.1.变量的定义与输出 1.变量的定义和赋值 1)局部变量的声明: DECLARE@variable_name DataType 例如: declare@stuname varchar(20)--声明一个存放学员姓名的变量stuname. declare@stuseat int--声明一个存放学员座位号的变量stuseat 2)局部变量的赋值: 局部变量的赋值有两种方法: a)使用Set语句 Set@variable_name=value b)使用Select语句 Select@variable_name=value 实验: 运行以下程序段,理解变量的使用。 --局部变量的赋值与使用 declare@customer_name varchar(20)--声明变量用来存放客户名称set@customer_name='家电市场'--使用SET语句给变量赋值select* from xss where客户名称=@customer_name--通过局部变理向sql语句传递数据请给出运行结果:

SQL循环语句的写法

SQL循环语句的写法 SQL循环语句 declare @i int set @i=1 while @i<30 begin insert into test (userid) values(@i) set @i=@i+1 end --------------- while 条件 begin 执行操作 set @i=@i+1 end WHILE 设置重复执行 SQL 语句或语句块的条件。只要指定的条件为真,就重复执行语句。可以使用 BREAK 和 CONTINUE 关键字在循环内部控制 WHILE 循环中语句的执行。 语法 WHILE Boolean_expression { sql_statement | statement_block } [ BREAK ] { sql_statement | statement_block } [ CONTINUE ] 参数 Boolean_expression 返回 TRUE 或 FALSE 的表达式。如果布尔表达式中含有 SELECT 语句,必须用圆括号将 SELECT 语句括起来。 {sql_statement | statement_block} Transact-SQL 语句或用语句块定义的语句分组。若要定义语句块,请使用控制流关键字 BEGIN 和 END。 BREAK

导致从最内层的 WHILE 循环中退出。将执行出现在 END 关键字后面的任何语句,END 关键字为循环结束标记。 CONTINUE 使 WHILE 循环重新开始执行,忽略 CONTINUE 关键字后的任何语句。 注释 如果嵌套了两个或多个 WHILE 循环,内层的 BREAK 将导致退出到下一个外层循环。首先运行内层循环结束之后的所有语句,然后下一个外层循环重新开始执行。 示例 A. 在嵌套的 IF...ELSE 和 WHILE 中使用 BREAK 和 CONTINUE 在下例中,如果平均价格少于 $30,WHILE 循环就将价格加倍,然后选择最高价。如果最高价少于或等于 $50,WHILE 循环重新启动并再次将价格加倍。该循环不断地将价格加倍直到最高价格超过 $50,然后退出 WHILE 循环并打印一条消息。 USE pubs GO WHILE (SELECT AVG(price) FROM titles) < $30 BEGIN UPDATE titles SET price = price * 2 SELECT MAX(price) FROM titles IF (SELECT MAX(price) FROM titles) > $50 BREAK ELSE CONTINUE END PRINT 'Too much for the market to bear' B. 在带有游标的过程中使用 WHILE 以下的 WHILE 结构是名为 count_all_rows 过程中的一部分。下例中,该 WHILE 结构测试用于游标的函数 @@FETCH_STATUS 的返回值。因为 @@FETCH_STATUS 可能返回–2、-1 或 0,所以,所有的情况都应进行测试。如果某一行在开始执行此存储过程以后从游标结果中删除,将跳过该行。成功提取(0) 后将执行 BEGIN...END 循环内部的 SELECT 语句。 USE pubs DECLARE tnames_cursor CURSOR FOR SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES

《C语言中的for循环》教案

《C语言中的for循环》教学设计 班级:计科软件对131 学号:124 姓名:李泽倩 日期:2016.6.12

《C语言中的for循环》教学设计 一、前端分析 (一)教材内容分析 C语言是国内外广泛使用的计算机语言,学会使用C语言进行程序设计是计算机专业本科生需要掌握的一项基本功。它在各高校计算机专业中既是其他课程的前期基础课,又是培养学生具有程序设计、调试能力的专业核心课程。程序设计的三种基本结构重中之重就是循环结构。而循环中的for循环是程序中运用最多的,它既是前面知识的延续,又是后面知识的基础。本文针对学生的实际情况,具体阐述for循环语句的教学方法和过程,使学生理解for循环语句的格式、功能和特点及其在具体编程时的灵活应用。 (二)学习者特征分析 大学生在智能发展上呈现出进一步成熟的特征。他们的思维有了更高的抽象性和理论性,并由抽象逻辑思维逐渐向辩证逻辑思维发展。他们观察事物的目的性和系统性进一步增强,已能按程序掌握事物本质属性的细节特征,思维的组织性、深刻性和批判性有了进一步的发展,独立性更为加强,注意更为稳定,集中注意的范围也进一步扩大。 二、教学目标设计 (一)知识与技能 1、领会程序设计中构成循环的方法

2、能使用for循环语句编写C语言程序,并能运用for循环语句解决程序设计中的实际问题。 (二)过程与方法 。C语言程序设计中for循环语句教学以行动导向教学为主线,通过“提出问题―分析问题―解决问题―问题扩展―讨论―总结归纳―实践”的程序,过渡到知识应用和练习。 本次课采用多媒体课件进行教学,通过课件把文字和图片有机的结合,使学生在学习过程中更加容易理解,学习效率高。在课堂讨论和实践过程中,教师适当引导,学生主动探究、归纳总结学习内容,既有利于学习新东西,又能充分发挥学生的主体作用。在重点的突破上,采用范例比较教学法,给出具体的案例,让学生通过典型的例子掌握知识,同时通过用while、do while语句的所编写的程序进行比较,加深学生印象,让学生快速的掌握for循环语句的基本结构及使用方法。 (三)情感与价值观: 1.让学生在自主解决问题的过程中培养成就感,为今后学会自主学习打下良好的基础。 2、培养学生学习的主观能动性,激发学生学习热情,以及培养团队合作的精神。 三、教学内容设计 教学重点:C语言程序设计循环结构程序中,要使用for循环语句进行程序设计,首先要求学生要掌握语句的基本格式,理解各个表达式的作用,以及执行过程,所以C语言程序设计中for循环语句的重点是“for语句的结构”。 教学难点:for语句的应用 学生掌握语句的结构和用法并不困难,难的是在实际的应用中那些时候该使用那种循环来解决问题比较简洁、高效,所以我把本节课的难点确定为“for语句的应用”。 四、教学策略分析 (一)教学方法 1、课堂讲授,给出主要内容。

中国电信C网网络优化培训材料

中国电信集团公司C网网络优化培训材料——设备平台部分

中博信息技术研究院有限公司 2010年5月

修订记录 3 / 3

前言 为了配合中国电信网优中心开展的网优人员认证工作,特编订本教材,由于编者学识有限,偏颇和不当之处在所难免,敬请各位网优人员不吝赐教,为修订工作提供宝贵意见。

目录 第1章基站系统主设备——中兴篇 (8) 1.1 中兴基站ZXSDR BS8800 (8) 1.1.1 BS8800在网络中的位置 (8) 1.1.2 BS8800系统组成 (9) 1.1.3 BS8800硬件结构 (9) 1.1.4 BS8800工作原理 (13) 1.1.5 BS8800要紧技术指标 (14) 1.2 中兴基站ZXC10 CBTS I2 (14) 1.2.1 CBTS I2在网络中的位置 (15) 1.2.2 CBTS I2系统组成 (15) 1.2.3 CBTS I2硬件结构 (16) 1.2.4 CBTS I2工作原理 (20) 1.2.5 CBTS I2要紧技术指标 (22) 3 / 3

1.3 中兴基站操纵器ZXC10 BSCB (23) 1.3.1 BSC在网络中的位置 (23) 1.3.2 BSC硬件结构 (24) 1.3.3 BSC组网配置 (29) 1.3.4 要紧技术指标 (30) 第2章基站系统主设备——华为篇 (32) 2.1 华为基站BTS3900 (32) 2.1.1 BTS3900在网络中的位置 (32) 2.1.2 BTS3900系统组成 (32) 2.1.3 BTS3900硬件结构 (33) 2.1.4 要紧技术指标 (38) 2.2 华为基站DBS3900 (39) 2.2.1 DBS3900系统组成 (39) 2.2.2 DBS3900硬件结构 (41)

相关主题
文本预览
相关文档 最新文档