Вы находитесь на странице: 1из 10

STRUCTURED QUERY

LANGUAGE
VIBRANT CAREER CLASSES
PRESENTED BY
DIVYA SHIRODKAR

What is SQL ?
SQL is everywhere, and I'm not saying that because I want you to use it. It's just a fact. I

bet you have some in your pocket right now. All Android Phones and iPhones have easy
access to a SQL database called SQLite and many applications on your phone use it
directly. It runs banks, hospitals, universities, governments, small businesses, large ones,
just about every computer and every person on the planet eventually touches something
running SQL. SQL is an incredibly successful and solid technology.
Standard Query Language (SQL) is at the heart of all relational databases, including IBM's
DB2, Oracle, Microsoft's SQL Server, and open source database MySQL.
SQL Process:
When you are executing an SQL command for any RDBMS, the system determines the
best way to carry out your request and SQL engine figures out how to interpret the task.

What is relational database

A relational database is a set of tables containing data fitted into predefined


categories. Each table (which is sometimes called arelation) contains one or more
data categories in columns. Eachrowcontains a unique instance of data for the
categories defined by the columns. For example, a typical business order entry
database would include a table that described a customer with columns for name,
address, phone number, and so forth. Another table would describe an order:
product, customer, date, sales price, and so forth. A user of the database could
obtain aviewof the database that fitted the user's needs. For example, a branch
office manager might like a view or report on all customers that had bought products
after a certain date. A financial services manager in the same company could, from
the same tables, obtain a report on accounts that needed to be paid.

Introduction to RDBMS and SQL


1. General RDBMS Concepts - Relational Vs. File Systems, normalization, ERD, extensibility
Flat Files vs. Relational Databases
Flat file is "A relatively simple database system in which each database is contained in a single
table (or two). In contrast, relational database systems use multiple tables to store
information, and each table can have a different record format. - ZDNets Definition.
Examples Scenario Order Entry System
File Database design:
Cust Name, Cust Address, Order Date, Order Header, Item 1, Qty 1, Price1, Item 2, Qty 2,
Price2, Item 3,
RDBMS
Customer Table :
Order Table:
Order Item Table:
Product Table:

Suggested Reading on Normalization

Name, Address
Link to Customer Table, Order Header .
Link to Order Table , Qty, Link to Product Table .
Product Name, Cost, Price, On Hand Qty ..

Where did it originate?


SQL has its origins in the relational model for data storage

which Ted Codd developed at IBM in 1970. An earlier form of


the language was Standard English Query Language, and
SQL, as we now know it, formed the basis of IBM's SQL-DS
and DB2 databases in the early 1980s. But they were beaten
into the field of SQL-based RDBMS by Oracle in 1979.

What is it for?

SQL was devised for manipulating data in relational database tables and, despite subsequent roles in handling extended data
types, that is still, essentially, what it does.
Now into its third decade of existence, SQL offers great flexibility to users by supporting distributed databases, i.e. databases
that can be run on several computer networks at a time.
Certified by ANSI and ISO, SQL has become a database query language standard, lying in the basis of a variety of well
established database applications on theInternettoday. It serves both industry-level and academic needs and is used on both
individual computers and corporate servers. With the progress in database technology SQL-based applications have become
increasingly affordable for the regular user. This is due to the introduction of various open-source SQL database solutions such
asMySQL,PostgreSQL, SQLite, Firebird, and many more.
Certified by ANSI and ISO, SQL has become a database query language standard, lying in the basis of a variety of well
established database applications on theInternettoday. It serves both industry-level and academic needs and is used on both
individual computers and corporate servers. With the progress in database technology SQL-based applications have become
increasingly affordable for the regular user. This is due to the introduction of various open-source SQL database solutions such
asMySQL,PostgreSQL, SQLite, Firebird, and many more.

Nine Reasons Developers Should Learn SQ


L
ITS PORTABLE
Computer science students are taught hundreds of techniques and theoretical constructs while they earn their degree. A lot of that information isnt directly

applicable in day to day programming tasks, but it introduces students to fundamental constructs that they can move between platforms they have a
common vocabulary and tool kit that they can take with them wherever they go.
Although every database vendor implements their own extensions, with every new version the vendors are moving their databases to be in line with the
ANSI/ISO SQL standard. Standards compliance, while tricky, makes it possible to take your knowledge from platform to platform. If you learn SQL, youll be
prepared to move from one database to another.
IT NEVER CHANGES
My good friend and business partner jokes that he became a DBA because SQL hasnt changed in 35 years. This is, largely, true. Vendors have implemented
their own extensions that eventually make it into the SQL standard, but the core of SQL doesnt change. Once you understand the basics of SQL and relational
theory (its not that hard), youll find that you can continue to build on that knowledge and add features and functionality that you were relying on other tools
or developers to implement.
ITS AN EASY PLACE FOR PERFORMANCE GAINS
There are only a few places to implement performance gains in an application the presentation layer, the application layer, and the storage layer. Lets face
it, your code is already well written and well tuned; getting any performance gains there is going to be like getting blood from a stone. The database, on the
other hand, is an easy place to make a few simple changes (add an index, change a query slightly) and see tremendous performance improvements. Having
spent a considerable portion of my career as an application developer staring at a profiler, I can attest to this. Its possible to pry performance improvements
out of application code, but modern frameworks and toolkits are typically so well-written that the database is usually a better place (read as easier place) to
find low hanging fruit for performance improvements.

Nine Reasons Developers Should Learn SQ


L

ITLL MAKE YOU A BETTER DEVELOPER


The Pragmatic Programmer challenges developers to learn a new language a year; not because the landscape is constantly changing but because learning new languages exposes developers to new paradigms. There are different ways of
thinking about problems that can lend themselves well to different solutions (Ive recently learned a lot from diving into functional programming). Learning SQL will teach you to think in sets rather than iteratively. In the long term, this will
change the way you think about working with data and lead to improvements in your database code.
IMPROVE COMMUNICATION ACROSS TEAMS
Have you ever tried to talk to someone who spoke your language but spoke a wildly different dialect? Communicating across a language barrier can be difficult outside of work, but it can be outright maddening when the success of a project
depends on it. Learning SQL will give you a leg up when youre communicating your goals to the DBA team. They wont have to decipher your meaning and you can tell them exactly what you need. In the end there will be less
miscommunication, things will get done faster, and youll no longer be that frustrating developer.
JOB SECURITY
I hate to say it, but learning SQL may mean that you get to keep your job when Ted in the next cube gets canned during layoff season. The more skills you have and the more job functions you can perform, the more valuable you become to
your current employer (and to a future employer). If you can work with the database team and the development team, youre now a valuable asset that both teams depend on for success.
Database administrators (DBAs) enjoy bright prospects in the job market, with the U.S. Bureau of Labor Statistics projecting that demand for DBAs will grow 15% from 2012 to 2022, far better than the average demand growth of just 10.8% for
all occupations. 1On top of that, the big data industry is expected to grow by 31% from 2012 to 2017. 2Hence, if you want to propel your chances at employment and enjoy a comfortable salary range, then deciding to eke out a living as a
database administrator is a smart move.
ITS REALLY NOT THAT HARD
Contrary to popular belief, SQL is not a difficult language to learn. Its a different way of thinking, thats for sure, but its not difficult. There are only a handful of commands, operators, and data types documented in the ANSI/ISO standard. While
vendors may add their own features, theres a compact core of knowledge that you can learn and apply everywhere you go.
KNOW WHEN ITSNOTAPPROPRIATE TO DO SOMETHING IN THE DATABASE
The database is a phenomenal tool for solving many problems, but its also a horrible tool for solving even more problems. To put it another way: you probably shouldnt be digging a trench with a hammer. By learning and understanding SQL,
youll be able to make better decisions and move poorly performing code out of the database. In fact, youll be able to spot these problems before theyre even problems.
Once you understand SQL, youll have a much better grasp on the limitations of an RDBMS. Youll know which portions of an application can safely live in a database and which will need to be moved further up the stack to a different layer.
Some data validations should live with the data, some shouldnt. Understanding how SQL works will help you determine which rules should remain in the database.
SIMPLIFY TROUBLESHOOTING
Live applications are notoriously difficult to troubleshoot. The more complexity and layers that are involved, the more difficult it is to troubleshoot an application. A good understanding of SQL makes it possible to rapidly isolate problems that do
exist in the database. To put it a different way: understanding SQL makes it easy to locate the problem in one of many different layers of your application.
Its no wonder SQL skills count among the most desired IT skills for years in a row. 4But even if a database-related profession doesnt struck a chord in your ensemble of career preferences, knowing at least one computer language is steadily
becoming mandatory in todays job market. SQL will give you a good background on how to generate useful information from a database, whichis acoolskill to have in the business intelligence department. 5

Systems Development
Life Cycle
Project Identification
and Selection
Project Initiation
and Planning
Analysis
Logical Design
Physical Design
Implementation
Maintenance

Database
Development
Process
Enterprise modeling

Conceptual data
modeling
Logical database design
Physical database
design and definition
Database
implementation
Database maintenance

10

Вам также может понравиться