LEARN SQL AND DATABASE MANAGMENT
This course provides a comprehensive introduction to SQL. By the end of the course, the student should be able to easily understand all the major aspects of SQL.
Is this course right for me?
This course is most suitable for programmers and web developers who are looking to expand their skills with SQL server
There are 12 lessons in this course:
Introduction to Databases
Fundamentals of SQL
Building a database with SQL
Storing & Retrieving Data
Advanced SQL database access methods
Using SQL in applications
Advice & Tips
Each lesson culminates in an assignment which is submitted to the school, marked by the school's tutors and returned to you with any relevant suggestions, comments, and if necessary, extra reading.
Understand the concept of relational databases.
Understand the fundamentals of SQL.
Build and maintain a database with SQL.
Define how to store data in a database using SQL.
Understand advanced and more efficient ways of working with databases in SQL.
Keep databases secure with SQL.
Understand how to use SQL in real world applications.
Define how to use cursors to work with data in a database.
Understand how to re-use common code and develop efficient database driven applications with the use of stored procedures.
Define the benefits of error handling and how to implement it.
Define how dynamic SQL works in applications.
Database Management System (DBMS)
A Database Management System (DBMS) is a software program that acts as a ‘go-between’ (interface) for the database information. When an application requires data, it sends its' request to the DBMS which searches the database records for the relevant data and then returns the result back to the application.
You can think of a DBMS as a librarian. You go to the library and ask them “have you got any books on car engine repairs”. The librarian then goes and looks through the shelves, finds all the relevant books and brings them back to you. Without the librarian, you would need to search through all the shelves yourself, which is slow and inefficient.
DBMSs make life easy and reduce the time it takes for an application to process data.
It is important to understand the difference between a Database and a DBMS. Many people confuse the two or do not realise there is a difference which can cause confusion.
DBMSs come in all shapes and sizes with different features and uses. Many have features that are unique and almost all DBMSs are incompatible with each other (although some have partial compatibility).
Some examples of popular DBMSs are:
- Microsoft Access
- Microsoft SQL Server
- Microsoft MSDE
- Sybase SQL Server
There are many other DBMSs around too. Some are general ones used for a variety of applications and some are specifically designed for certain applications (such as banking and finance).
SQL (structured query language) is the most common language used for communicating with relational databases.
Traditionally, programming languages such as Basic, C# and C++ are known as ‘procedural’ languages. This means that in order to do something, a procedure is written telling the computer what to do.
For example, to get the computer to draw a box, you would have a procedure similar to the following:
1) Move the pointer to the top left of the screen
2) Draw a line horizontally until it reaches the edge of the screen
3) Draw a line down until it reaches the bottom of the screen
4) Draw a line to the left until it reaches the left hand side of the screen
5) Draw a line up until it meets the top left corner of the screen
SQL is a ‘non-procedural’ language. Instead, you tell SQL what you want and it communicates with the DBMS to retrieve your request without you having to tell SQL exactly how to do it.
For example, to retrieve all records from a database where all people lived in Australia, you would use the following SQL command:
Select * from records where location=’Australia’
The DBMS then understands what SQL is asking and will go and retrieve the data and send it back to SQL.
SQL commands are performed in one of two ways:
1) Via a console
You can execute SQL commands via a console that is connected to a DBMS. This may be the SQL query builder in Microsoft Access, a web page connected to a database of some sort, or either via SQL Server Express, Enterprise Manager & Query Analyser for SQL Server. You would simply type in your request in SQL and after the task has been completed, you will see the result. This form of using SQL is generally only used by professional database administrators due to the large margin for error and lack of database security (someone could easily wipe out a database by typing the wrong command).
2) Via an application
This is the most common form of SQL programming. An application acts as a ‘front end’ for the database, allowing someone with basic computer knowledge to use a database. For example, a button that says ‘add record’ would appear on a page with blank fields for ‘name’ and ‘address’. The operator would enter the name and address then click the button. This button would then fire off an SQL command, telling the DBMS to add a new record to the database with the data the operator typed in.