of data. It models relevant aspects of reality in a way that supports processes requiring this informa1on. Alterna1vely, a database is a collec1on of tables, with related data. Physically, database servers are dedicated computers that hold the actual databases and run only the DBMS and related soCware.
recorded and have meaning in the user's environment Alterna1vely, data are values of qualita1ve or quan1ta1ve variables, belonging to a set of items. Sets are important.
system (DBMS) is a soCware system designed to allow the defini1on, crea1on, querying, update, and administra1on of databases. Examples: MySQL, PostgreSQL, SQLite, MicrosoC SQL Server, MariaDB Because they are so closely related, the term "database" when used casually oCen refers to both a DBMS and the data it manipulates.
set of soCware programs provides all users with access to all the data. Databases can inter-‐operate by using standards such as SQL, ODBC (open database connec1vity), or JDBC (Java database connec1vity).
mainly talking today about the rela1onal model. Why? Because it’s a good place to start. At least in my opinion. We will men1on NoSQL and how rela1onal databases interact with object oriented programming.
a database, removing data structures from the database, modifying the structure of exis1ng data. Update Inser1ng, modifying, and dele1ng data. Retrieval Obtaining informa1on either for end-‐user queries and reports or for processing by applica1ons. Administra)on Registering and monitoring users, enforcing data security, monitoring performance, maintaining data integrity, dealing with concurrency control, and recovering informa1on if the system fails.
A table in a database looks like a simple spreadsheet. Column One column (data element) contains data of one and the same kind. Row A row (= tuple, entry or record) is a group of related data.
key value can not occur twice in one table. With a key you can find at most one row. Foreign Key A foreign key is the linking pin between two tables. Compound Key A compound key (composite key) is a key that consists of mul1ple columns, because one column is not sufficiently unique.
is a special-‐ purpose programming language designed for managing data held in a RDBMS. The scope of SQL includes data insert, query, update and delete, schema crea1on and modifica1on, and data access control. Although SQL is oCen described as, and to a great extent is, a declara1ve language (4GL), it also includes procedural elements.
purpose: to query data contained in a rela1onal database. SQL is a set-‐based, declara1ve query language, not an impera1ve language like C or BASIC. However, there are extensions to Standard SQL which add procedural programming language func1onality, such as control-‐of-‐flow constructs.
American NaEonal Standards InsEtute (ANSI) in 1986 as SQL-‐86[33] and the InternaEonal OrganizaEon for StandardizaEon (ISO) in 1987. Nowadays the standard is subject to conEnuous improvement by the Joint Technical CommiWee ISO/IEC JTC 1, InformaEon technology, SubcommiWee SC 32, Data management and interchange which affiliate to ISO as well as IEC. It is commonly denoted by the paWern: ISO/IEC 9075-‐ n:yyyy Part n: Etle, or, as a shortcut, ISO/IEC 9075.
types, and the rela1onships among them Data Manipula1on Language (DML) Performs tasks such as inser1ng, upda1ng, or dele1ng data occurrences Query Language Allows searching for informa1on and compu1ng derived informa1on
the subset of SQL used to add, update and delete data. Some basic items of DML are the SELECT, UPDATE, and DELETE statements. The Data Defini1on Language (DDL) manages table and index structure. The most basic items of DDL are the CREATE, ALTER, RENAME, DROP and TRUNCATE statements.
data types. Here are some: Character strings CHARACTER(n) or CHAR(n): fixed-‐width n-‐character string, padded with spaces as needed CHARACTER VARYING(n) or VARCHAR(n): variable-‐width string with a maximum size of n characters NATIONAL CHARACTER(n) or NCHAR(n): fixed width string suppor1ng an interna1onal character set NATIONAL CHARACTER VARYING(n) or NVARCHAR(n): variable-‐ width NCHAR string
2011-‐05-‐03) TIME: for 1me values (e.g. 15:51:36). The granularity of the 1me value is usually a 1ck (100 nanoseconds). TIME WITH TIME ZONE or TIMETZ: the same as TIME, but including details about the 1me zone in ques1on. TIMESTAMP: This is a DATE and a TIME put together in one variable (e.g. 2011-‐05-‐03 15:51:36). TIMESTAMP WITH TIME ZONE or TIMESTAMPTZ: the same as TIMESTAMP, but including details about the 1me zone in ques1on.
and retrieval of data that uses looser consistency models than tradiEonal relaEonal databases. MoEvaEons for this approach include simplicity of design, horizontal scaling and finer control over availability. NoSQL databases are o`en highly opEmized key–value stores intended for simple retrieval and appending operaEons, with the goal being significant performance benefits in terms of latency and throughput.
between incompa1ble type systems in object-‐oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. The heart of the problem is transla1ng the logical representa1on of the objects into an atomized form that is capable of being stored on the database, while somehow preserving the proper1es of the objects and their rela1onships so that they can be reloaded as an object when needed.