You are on page 1of 2
{A relational database Is a collection of tables, A table Is a set of columns and rows. All data is stored in tables. Every table has a name. In a well-designed database, each table contains data about a specific subject (entiy): hind one data about projects, v= OS p ‘The data base management system manages the data. f someone requires information about an employee, he/she must talk to the data management system ina language whieh the aysterh underatands SAL“ Stictured ‘Gucr/ Language: A query requires: 1. Someone wno requests data (data requestor) 3. A language understood by both sides 5. A poo! with tne desired inrormation ‘SOL can be used either interactively or embedded in an application program, for example, COBOL, PL/I, oF C- ‘Te opject of a DML query Is a set of tables. The result of ine DML query Is a set of qualifying rows from these tables. = DDLis mostly used by data base administrators to define DB2 UDB objects such {a5 lables, views and indices: + DML is used by all data base users fo retrieve information or to maintain data = DCLis also used by data base administrators to allow or disallow activities In DB2 UDB by granting or revoking privileges ‘Most Relational Database Managers understand SQL. + Every table nas a name. + Every column has a name. = Column names must be unique within a table. - Rows are normally stored unordered - For each row, a column nas one entry (rela) + All values of 2 column have the same data type. + Every table must have a unique name. ~ Every table name consists of at least two parts referred to as simple table name and its qualifier (tables used in a distributed processing environment may have three part names), ~ The qualifier precedes the simple table name and is separated from it by a period. = The simple table name must be unique within a qualifier. NOF NULL Column muet atwaye nave e value, beraucy I we do not Supply one, a syston Coweta Sr unor defined default value wilt Purpose: = Improved data security ¢ Improved data independence 1 Simplification for the end user (less data, more user-friendly column names) Properties: + No additional data is stored. = A view encompasses a subset of columns and rows. + A view may encompass data from several tables and/or other views. 1A View may encompass derived data, for example, averages < Data manipulation Via some views Is limited + Resulting rows are sequenced according to columns listed in the ORDER BY clause. + The keyword ASC means sort in ascending sequence. This is the default sort sequence and the keyword ASC may be omitted + DESC means sort in descending sequence. + Depending on the environment, columns used in the ORDER 8Y clause must be a part of the result table. + DISTINCT ensures that the result contains unique rows. DISTINCT removes duplicate rows. + The keyword DISTINCT must immediately follow the word SELECT. It is effective at the row level To qualify specific table rows for further processing use the WHERE clause to specify the conditions rows must meet to be part of the result table. When predicates are combined via AND, for a row to qualify. both predicates must be true. For predicates combined via OR. rows qualify if at least one predicate is true. When AND is used between predicates, for @ row to qualify, both conditions must be met. The IN predicate compares a value with 2 set of values. ‘The BETWEEN predicate determines if @ given value lies between and including two values specified in ascending order (/ow value listed first, the higher or equal value must be listed after the AND). The NULL predicate tests for null vaiués. The result of "IS NULL” cannot be unknown. If the value of the expression is null, the result Is true. If the value is not null, the result is false. If "IS NOT NULL" Is specified, the result is reversed. + The LIKE pres - In the pattern the percent sign ("%') serves as place holder for a string of zero or more arbitrary characters. sate searches for character strings that have a certain pattern.

You might also like