Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
SQL
Edit
PageHistory
Diff
Info
LikePages
[Acronym] for __S__tructured __Q__uery __L__anguage. Some DataBase professionals think the ''S'' should stand for "stupid." [SQL] is a set-centric ProgrammingLanguage in which statements are excuted over a [Schema] of relations (tables), and return a table of results. !! Syntax and examples In this example, imagine we have a table called <tt>users</tt> which has an <tt>id</tt>, a <tt>name</tt> and an <tt>accesslevel</tt> column. __Retrieving data:__ <pre> SELECT ''col_1'', ''col_2'', ''col_n'' FROM ''table'' WHERE ''condition'' </pre> Eg. to find the access level of user number 154:'''' <pre> SELECT accesslevel FROM users WHERE id = 154; </pre> __Inserting data:__ <pre> INSERT INTO ''table'' (''column_one'', ''column_...'', ''column_n'') VALUES (''value_one'', ''value_...'', ''value_n'') </pre> Eg. to add a new user:'''' <pre> INSERT INTO users (name, accesslevel) VALUES ('Craig', 10); </pre> The next available ID number is automatically assigned. __Updating data:__ <pre> UPDATE ''table'' SET ''column_one''=''value_one'', ''column_...''=''value_...'', ''column_n''=''value_n'' WHERE ''condition'' </pre> Eg. to set an accesslevel of 15 to everyone whos name starts with a C:'''' <pre> UPDATE users SET accesslevel=15 WHERE name LIKE 'C%'; </pre> __Removing data:__ <pre> DELETE FROM ''table'' WHERE ''condition'' </pre> Eg. to remove the user with ID number 30:'''' <pre> DELETE FROM users WHERE id = 30; </pre> ---- Part of CategoryProgrammingLanguages and CategorySpecialPurposeProgrammingLanguages
23 pages link to
SQL
:
SubSelect
WinFs
ODBC
RAD
PostRelationalDataBase
JDBC
WAL
WaikatoCourseDescriptions
RelationalDataBase
DB2
FlatFiles
MicrosoftAccess
FreeRADIUSNotes
Schema
XMLDataBase
HierarchicalDataBase
CarlWyles
XML
NSS
MySQL
LDAP
PostgreSQL
PostgreSQLNotes