SQL: Unterschied zwischen den Versionen

Aus informatikvs
Wechseln zu: Navigation, Suche
Zeile 37: Zeile 37:
 
== snippets ==
 
== snippets ==
 
<pre> ... dec(round(plan_mod, +2), 6, 2)</pre>
 
<pre> ... dec(round(plan_mod, +2), 6, 2)</pre>
<pre> ... date(a.abdagc+693594) = current_date </pre
+
<pre> ... date(a.abdagc+693594) = current_date </pre>
 +
<pre>
 +
insert into tdatbib.v7tabgld (v7apid, v7tbnr, v7tgid, v7spcd, v7tgtx)
 +
          values('KW', 386, '      758', 'D', 'Max.Mueller@test.de');
 +
select *
 +
from datbib.zz
 +
left outer join tdatbib.v7tabgld on (v7apid, v7tbnr, v7tgid, v7spcd)
 +
                                  =('KW', 386, ('      ' concat zzusrk), 'D')
 +
where zzusrk='357'
 +
</pre>

Version vom 2. Mai 2017, 12:40 Uhr

terms

sql-ddl
(Data Definition Language) das erstellen/ändern/löschen von datenbankstrukturen (tables, fields, views, ...)


sql-dml
(Data Manipulation Language) das erstellen/ändern/löschen des inhalts (daten) der datenbankstrukturen


sql-dcl
(Data Control Language) Transaktionskontrolle und Zugriffsberechtigungen


sql-injection


transaktionen


attribut


index


commands
such as "Select", "Insert", "Update", "Delete", "Create", and "Drop"


tables
are uniquely identified by their names and are comprised of columns and rows.


columns
contain the column name, data type, and any other attributes for the column.


rows
contain the records or data for the columns.


the where-clause
optional specifies which data values or rows will be returned (criterias: =, <>, <, >, >=, <=, like)


tuple
is a collection of one or more attributes or rows present in a table


constraints
are uses to limit the values of variables NOT NULL; UNIQUE; PRIMARY KEY; FOREIGN KEY; CHECK; DEFAULT


subquery


aggregat functions
avg(); count(); count(dinstinct field); max(); ...


scalar functions
ucase(), lcase(), mid(), len(), left(), right(), round(), mod(), now()


olap cube() rollup()

snippets

 ... dec(round(plan_mod, +2), 6, 2)
 ... date(a.abdagc+693594) = current_date 
insert into tdatbib.v7tabgld (v7apid, v7tbnr, v7tgid, v7spcd, v7tgtx) 
          values('KW', 386, '       758', 'D', 'Max.Mueller@test.de');
select * 
from datbib.zz 
left outer join tdatbib.v7tabgld on (v7apid, v7tbnr, v7tgid, v7spcd)
                                   =('KW', 386, ('       ' concat zzusrk), 'D')
where zzusrk='357'