Escolar Documentos
Profissional Documentos
Cultura Documentos
RDBMS
Database is a collection of: {tables, views, synonyms, defaults, rules}
http://it.toolbox.com/wiki/index.php/Relational_Database_Management_System
what is a Database?
DBMS
disadvantages
global exposure
check http://es.wikipedia.org/wiki/DBMS
http://es.wikipedia.org/wiki/Sistema_Administrador_de_Bases_de_Datos
Characteristics
supports very large storage
network
high security
Database
collection of records=objects
collection of data=record
data
1 to 1
1 to many
many to many
view
table
default
user
designer
SECURITY
types
the db is designed so depending on the user it will have limited or complete access
data integrity
refers to the consistency order and condition in which the data is stored in the objects and the
relationship they have
data conectivity
conditions for the designs for example the same types of values, same fields between tables,
columns, rows
RELATIONAL DATABASE
PRIMARY KEY
FOREIGN KEY
Keys A unique key is a kind of constraint that ensures that an object, or critical information about
the object, occurs in at most one tuple in a given relation. For example, a school might want each
student to have a separate locker. To ensure this, the database designer creates a key on the
locker attribute of the student relation. Keys can include more than one attribute, for example, a
nation may impose a restriction that no province can have two cities with the same name. The
key would include province and city name. This would still allow two different provinces to have a
town called Springfield because their province is different. A key over more than one attribute is
called a compound key.
Foreign keys
A foreign key is a reference to a key in another relation, meaning that the referencing tuple has,
as one of its attributes, the values of a key in the referenced tuple. Foreign keys need not have
unique values in the referencing relation. Foreign keys effectively use the values of attributes in
the referenced relation to restrict the domain of one or more attributes in the referencing relation.
A foreign key could be described formally as "For all tuples in the referencing relation projected
over the referencing attributes, there must exist a tuple in the referenced relation projected over
those same attributes such that the values in each of the referencing attributes match the
corresponding values in the referenced attributes".
LANGUAGES
LEVELS:
DATABASE MANAGER responsible for converting user queries to appropiate system calls
Structured Query Language (SQL) is a standard programming language used for accessing and
maintaining a database.The key feature of the SQL is an interactive approach for getting
information from and updating a database. The SQL is both ANSI and ISO standard supported by
most standard databases and the most popular programming language for the retrieval and
management of data in relational database management systems, database schema creation and
modification, and database object access control management.Though the SQL comes in many
flavors, for instance besides the standard SQL syntax, the Oracle databases also utilize their
proprietary PL/SQL, similarly Microsoft SQL Server utilize their Transact-SQL.All of these
variations, through proprietary, are based upon the industry standard ANSI SQL.
SQL- Structured Query Language is the set of commands that are used to create , manipulate the
structures in a relational database. Also, SQL is the most powerful way of retriving the data from
DB. SQL supports different types of operations. Based on this the commands can be broadly
classified into following types.
• Data Definition Language
• Data Manipulation Language
• Transaction Control Language
• Session Control Language
• System Control Language
SQL code
example
table created
DML INSERTING, DELETING, ADDING, CREATING VALUES IN THE TABLE WE CREATED(IN THE
STRUCTURE)
1 record created
DISPLAY
select * from employee; >>>* means all the records will be displayed
condition if you want to retrieve the records, with math or logical operators
2000, 2200
the column with the operation will be a virtual column that is created
using clause for example if we want to fin employee 800th from a 1000 employees table:
RELATIONAL, LOGICAL