Modern algebra, which not long ago seemed to be a science divorced from real life, now has numerous applications. Many fine algebraic structures are endowed with meaningful contents. Now and then practice suggests new and unexpected structures enriching algebra. This does not mean that algebra has become merely a tool for applications. Quite the contrary, it significantly benefits from the new connections. The present book is devoted to some algebraic aspects of the theory of databases. It consists of three parts. The first part contains information about universal algebra, algebraic logic is the subject of the second part, and the third one deals with databases. The algebraic material of the flI'St two parts serves the common purpose of applying algebra to databases. The book is intended for use by mathematicians, and mainly by algebraists, who realize the necessity to unite theory and practice. It is also addressed to programmers, engineers and all potential users of mathematics who want to construct their models with the help of algebra and logic. Nowadays, the majority of professional mathematicians work in close cooperation with representatives of applied sciences and even industrial technology. It is neces sary to develop an ability to see mathematics in different particular situations. One of the tasks of this book is to promote the acquisition of such skills.