LevSelector.com |
SQL
• sql tutorials
• books
• useful commands
SQL Tutorials | home - top of the page - |
Today SQL is the standard for getting information from and updating
to a database. All serious databases support it (Oracle, Sybase, DB2, and
many others). SQL queries let you select, insert, update, find out
the location of data, and so forth.
Assignment - look up what is SQL (it is a special programming
language) on www.whatis.com
SELECT DISTINCT you FROM ALL_PEOPLE
WHERE database_knowledge > 0
Transact SQL - extention of standard SQL supported by
3 big databases:
Sybase, DB2 ver.7,
and Microsoft SQL Server
PL/SQL - Procedural Language extension to SQL supported
by Oracle
SQLJ - an alternative to JDBC - a way to include SQL into
java (Oracle, IBM, etc.)
Read these 2 short SQL tutorials:
• sql_tut - short SQL introduction (using Microsoft syntax) • sql_sybase - short SQL intro (Sybase SQL server) Solve these SQL problems: • sql_test0 - 6 SQL problems with answers • sql_test1 - more than 60 problems with answers (from SQL tutor software) • www.mssqlserver.com/tsql/
- download a course: TSQL, SQL, database design, data warehousing, replication,
and OLAP
• sqlcourse.com/
- SQL tutorial
|
books | home - top of the page - |
SQL:
• Lan Times Guide to Sql • James R. Groff, Paul
N. Weinberg
• The Practical Sql Handbook : Using Structured
Query Language • Judith S. Bowman et al (1996)
• Joe Celko's SQL for Smarties: Advanced SQL
Programming - by Joe Celko. Paperback (October 8, 1999)
some useful commands | home - top of the page - |
Some useful commands:
select * from ABC where 1=2
Sybase: | Oracle: | DB2: | MySQL: |
isql | sqlplus | db2 | mysql
cat file | mysql > result |
set rowcount 5
select * from ABC |
select * from EMP
where rownum <= 5 |
select * from ABC
fetch first 5 rows only |
select * from ABC
limit 5,10; # Retrieve rows 6-15 select * from ABC
|
use some_db
go |
connect user@con_string | use some_db; | |
sp_help
sp_help some_table sp_helpdb sp_helptext |
help
select tname from tab; select table_name from dict where table_name like '%USER%'; ... |
show databases;
show tables; |
-------------------------------------