PHP Manual
PEAR Manual
Smarty Manual
PostgreSQL
MySQL Manual
Perl Manual
Ciekawe adresy
Czytnik RSS
» Internauci wolą surfowanie po sieci od seksuO zgrozo. Jak wynika z sondażu PBI, internauci w wolnym czasie najchętniej wybierają surfowanie po sieci (90 proc.). Seks wskazała nieco ponad jedna czwarta ankietowanych.
» III Internetowe Mistrzostwa Polski w Programowaniu
8 grudnia w poniedziałek rozpoczynają się "III Internetowe Mistrzostwa Polski w Programowaniu". Zawody będą podzielone na cztery tury; pierwsza kończy się za dwa dni. Aby wziąć udział w turnieju, "przede wszystkim należy znać któryś z języków programowania: Pascal, C lub C++ [...] Przydaje się znajomość algorytmów, struktur danych i umiejętności szacowania złożoności czasowej. Jednak głównie liczy się inteligencja i pomysłowość."
» HP oferuje centra danych z gotowych elementów
Centra danych zbudowane z gotowych elementów mają pozwolić na obniżenie kosztów budowy centrów nawet o połowę.
» HTC i Windows Mobile Phone 7 - może być źle.
Kiedy wiele firm produkujących telefony komórkowe prowadziło negocjacje z dostawcami Windows Mobile (Microsoft) i Androida (Google) o zawarciu ich w swoich produktach, jednocześnie wyposażając kilka telefonów rocznie w te systemy, HTC stworzyło więcej telefonów opartych o to oprogramowanie niż firmy wiele razy od niej większe. Była to też pierwsza firma, która wprowadziła na rynek telefon komórkowy z systemem operacyjnym Android.Microsoft na targach Mobile World Congress 2009 przytoczył HTC jako wyjątkowego partnera. Trzeba mieć przy tym na uwadze, że wyróżnienie to zostało przyznane, kiedy telefon Google Nexus One produkowany przez HTC jest sprzedawany tylko przez największą konkurencję Microsoftu.HTC zrobiło coś więcej niż proste tworzenie dużej liczby telefonów dla tych systemów operacyjnych. Przykuło uwagę użytkowników swoim designem, który zawierał jedne z największych wyświetlaczy i najlepsze klawiatury QWERTY, jak również mądrymi ruchami, jak zawartym w telefonie Touch Pro 2 trybem głośnomówiącym, aktywującym się po spojrzeniu twarzą na wyświetlacz podczas rozmowy. Jednak co najważniejsze, HTC mocno zainwestowało w tworzenie łatwych w użyciu interfejsów użytkownika dla obu systemów operacyjnych. Zespoły projektujące skupiały się na dostarczaniu skórek jak TouchFlo i Sense zarówno dla Windows Mobile i Androida. Jednak teraz Microsoft radykalnie zmienia Windows Phone 7, dlatego HTC również będzie musiało zmienić swoje oprogramowanie i jednocześnie straci rangę posiadania mocno modyfikowalnych interfejsów użytkownika zarówno dla Windows Mobile i Androida.
introduction to relational databases
postgresql is a sophisticated object-relational database management system (ordbms). an ordbms is an extension of the more traditional relational database management systems (rdbms). an rdbms enables users to store related pieces of data in two-dimensional data structures called tables. this data may consist of many defined types, such as integers, floating-point numbers, character strings, and timestamps. data inserted in the table can be categorized using a grid-like system of vertical columns, and horizontal rows. the relational model was built on a strong premise of conceptual simplicity, which is arguably both its most prominent strength and weakness.
the object-relational aspect of postgresql adds numerous enhancements to the straight relational data model. these include support for arrays (multiple values in a single column), inheritance (child-parent relationships between tables), and functions (programmatic methods invoked by sql statements). for the advanced developer, postgresql even supports extensibility of its data types and procedural languages.
due to this object-relational concept, tables are sometimes called classes, while rows and columns can be referred to as object-instances and object-attributes, respectively. we will use this terminology interchangeably in this book. other sql data structures, such as indices and views, can be referred to as database objects.
note: take care to observe that object-relational is not synonymous with object-oriented, a term pertaining to many modern programming languages. while postgresql supports several objective improvements to the relational model, it is still accurate to refer to postgresql as a relational database management system (rdbms).
understanding databases
while postgresql is commonly considered an rdbms, or a "database," it may not be commonly understood what is meant specifically by the word database. a database within postgresql is an object-relational implementation of what is formally called a schema in sql99.
put simply, a database is a stored set of data that is logically interrelated. typically, this data can be accessed in a multiuser environment. this is the case with postgresql, though there are well-defined rights and restrictions enforced with that access.
it may not be commonly understood that postgresql can have several databases concurrently available, each with their own owner, and each with their own unique tables, views, indices, sequences, and functions.
in order to create a table, function, or any other database object, you must connect to a specific database via a postgresql client. once connected, you can create an object, which is then owned by the connected database, and therefore is inaccessible from any other database (though a client may have several connections open to different databases).
by keeping fundamental data objects segregated into their own databases in this fashion, you run a smaller risk of running into a naming collision by choosing a table name already chosen for another purpose (e.g., if two users each wanted to have a table called products for two separate applications). this is because neither database has any knowledge of the other database's components, and will not attempt to make any kind of logical relationship between them. furthermore, as the same rule applies to object-relational data objects, users may even create functions and language definitions within their database that are inaccessible to other users connected to other databases running within postgresql.
by default, postgresql installs only one functional database, which is called template1 to represent the template nature of the database. any database created after template1 is essentially a clone, inheriting any of its database objects, including table structure, functions, languages, etc. it is not uncommon to create a default database for new postgresql users with the same name as their postgresql username, as postgresql will attempt to connect to a database with the same name as the connecting user if a database name is not specified.
understanding tables
tables are quite possibly the most important aspect of sql to understand inside and out, as all of your data will reside within them. in order to be able to correctly plan and design your sql data structures, and any programmatic routines toward accessing and applying that data, a thorough understanding of tables is an absolute pre-requisite.
a table is composed of columns and rows, and their intersections are fields. if you have ever used spreadsheet software before (such as excel), these two terms are visually represented in the same manner, and the fields within a table are equivalent to the cells within a spreadsheet. from a general perspective, columns within a table describe the name and type of data that will be found (and can be entered) by row for that column's fields. rows within a table represent records composed of fields that are described from left to right by their corresponding column's name and type. each field in a row is implicitly correlated with each other field in that row. in this sense, columns can be thought of as descriptors for the discrete, sequential elements of a row, and each row can be thought of as a stored record matching that description.
table 3-1 illustrates a simple table called books, used by our imaginary bookstore, book town. we will frequently refer to this table in later examples. each of its stored records describes a book by a numeric identifier, title, author identifier, and subject identifier. these characteristics, from left to right, are described by its columns (id, title, author_id, and subject_id).
table 3-1. an example sql table
id | title | author_id | subject_id |
|---|---|---|---|
7808 | the shining | 4156 | 9 |
156 | the tell-tale heart | 15 | 9 |
4513 | dune | 1866 | 15 |
4267 | 2001: a space odyssey | 2001 | 15 |
1608 | the cat in the hat | 1809 | 2 |
1590 | bartholomew and the oobleck | 1809 | 2 |
as you can see, this describes a table with four columns, in a fixed, left-to-right order, currently populated by six rows (also known as tuples, or records). it is essential to understand that in a relational database, while a table has a fixed column order, rows themselves are inherently unordered. you will see later, as the sql's query structure is explained in chapter 4, that there are ways within sql to order selected rows. however, the rows in the database itself are not automatically ordered in any consistently predictable way. when order is meaningful for a sql query, you must carefully consider and explicitly order records.
every table must have at least one column, but tables may at times contain no rows, because each vertical column corresponds to a relatively fixed attribute of the data represented in that table (such as the title column in the previous example's books table). without a column, a row's contents would be ambiguous; without a row, a table is merely lacking recorded data. as of postgresql 7.1, there is a maximum of 1600 columns to a table, and an unlimited number of rows (i.e., you are limited only by hardware limitations, such as disk space).
in table 3-1, the column names fairly clearly indicate the significance of each column. the decision of how to name columns is fairly arbitrary, though, and care must be taken in planning table names and conventions to avoid ambiguity.
though it may not be immediately obvious, each of the columns of a table have an associated data type. while a column's data type helps to further describe the sort of information it contains, it constrains the kind of data that may be inserted into the column. for example, the author_id column is of type integer; this signifies that any insertion attempts not consisting of pure a integer (e.g., 110a) will fail. these types are described in more detail in the section called data types."
this section introduced the general concepts of how data is logically arranged in a relational database and within tables. the next section explains why statements are the basis for all interactions with the database.
Najskuteczniejsza reklama to pozycjonowanie - Pozycjonowanie stron <= zajrzyj tu i dowiedz się więcej o pozycjonowanie stron