Structured Query Language Path from Unorganized to Organized….

Slides:



Advertisements
Similar presentations
Basic SQL Introduction Presented by: Madhuri Bhogadi.
Advertisements

Virtual training week 4 structured query language (SQL)
SQL components In Oracle. SQL in Oracle SQL is made up of 4 components: –DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE. Creates / Alters.
Structured Query Language Part II Chapter Three CIS 218.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
Structured Query Language Chapter Three (Excerpts) DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
30-Jun-15 SQL A Brief Introduction. SQL SQL is Structured Query Language Some people pronounce SQL as “sequel” Other people insist that only “ess-cue-ell”
Structured Query Language Chapter Three DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Database Management System LICT 3011 Eyad H. Elshami.
Chapter 7: SQL, the Structured Query Language Soid Quintero & Ervi Bongso CS157B.
DATABASES AND SQL. Introduction Relation: Relation means table(data is arranged in rows and columns) Domain : A domain is a pool of values appearing in.
Oracle Data Definition Language (DDL)
Structured Query Language (SQL) A2 Teacher Up skilling LECTURE 2.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
Structured Query Language Chapter Three DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
ORACLE SQL. Overview Personal DBMS Vs Client/Server DBMS Oracle 8 Environment SQL – syntax and examples PL/SQL-introduction.
Guofeng Cao CyberInfrastructure and Geospatial Information Laboratory Department of Geography National Center for Supercomputing Applications (NCSA) University.
Oracle Data Definition Language (DDL) Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
SQL SQL Server : Overview SQL : Overview Types of SQL Database : Creation Tables : Creation & Manipulation Data : Creation & Manipulation Data : Retrieving.
Quick review of SQL And conversion to Oracle SQL.
Nitin Singh/AAO RTI ALLAHABAD 1 SQL Nitin Singh/AAO RTI ALLAHABAD 2 OBJECTIVES §What is SQL? §Types of SQL commands and their function §Query §Index.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
SQL Structured Query Language 1. Data Definition Language (DDL) is used to manage table and define data structure i.e. CREATE, ALTER, DROP Data Control.
Database Lab Lecture 1. Database Languages Data definition language ( DDL ) Data definition language –defines data types and the relationships among them.
Prince Sultan University Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
SQL: Part 1 Original materials supplied by the Oracle Academic Initiative (OAI). Edited for classroom use by Professor Laku Chidambaram. Not for commercial.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Visual Programing SQL Overview Section 1.
CMPT 258 Database Systems The Relationship Model (Chapter 3)
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
1 CS 430 Database Theory Winter 2005 Lecture 11: SQL DDL.
© 2002 by Prentice Hall 1 Structured Query Language David M. Kroenke Database Concepts 1e Chapter 3 3.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
SQL. Originally developed by IBM Standardized in 80’s by ANSI and ISO Language to access relational database and English-like non-procedural Predominant.
Introduction to Database SEM I, AY Department of Information Technology Salalah College of Technology Chapter No.3 SQL.
Physical Model Lecture 11. Physical Data Model The last step is the physical design phase, In this phase data is – Store – Organized and – Access.
SQL, the Structured Query Language
Fundamentals of DBMS Notes-1.
Database Languages.
CHAPTER 7 DATABASE ACCESS THROUGH WEB
Structured Query Language
SQL Query Getting to the data ……..
TABLES AND INDEXES Ashima Wadhwa.
Managing Tables, Data Integrity, Constraints by Adrienne Watt
SQL: Schema Definition and Constraints Chapter 6 week 6
Advanced Accounting Information Systems
Insert, Update and the rest…
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
ORACLE SQL Developer & SQLPLUS Statements
“Introduction To Database and SQL”
DATABASE MANAGEMENT SYSTEM
لغة قواعد البيانات STRUCTURED QUERY LANGUAGE SQL))
SQL OVERVIEW DEFINING A SCHEMA
“Manipulating Data” Lecture 6.
مقدمة في قواعد البيانات
Database systems Lecture 3 – SQL + CRUD
“Manipulating Data” Lecture 6.
Oracle Data Definition Language (DDL)
SQL .. An overview lecture3.
Session - 6 Sequence - 1 SQL: The Structured Query Language:
Chapter 2: Creating And Modifying Database Tables
Chapter # 7 Introduction to Structured Query Language (SQL) Part I.
MIS2502: Data Analytics SQL 4– Putting Information Into a Database
Structured Query Language – The Basics
Session - 6 Sequence - 1 SQL: The Structured Query Language:
SQL Tutorial Basic SQL Commands
SQL (Structured Query Language)
Presentation transcript:

Structured Query Language Path from Unorganized to Organized…. SQL Structured Query Language Path from Unorganized to Organized…. © wideskills.com

What is a Database… A database is an organized collection of data. The database management system(DBMS) is the system which acts as medium to carry data from database and user. There are 4 types of DBMS Hierarchical DBMS Network DBMS Relational DBMS Object Oriented DBMS © wideskills.com

What is SQL… SQL is the standard used to manage data in relational tables. Structured Query Language normally referred as SQL and pronounced as SEE QU EL.. SQL allows users to create databases, add data, modify and maintain data. It is governed by standards maintained by ISO(International Standards Organization). Example of a relational table: Employee Department Emp Id Emp Name Age Dept_id 1 John 40 2 Linda 35 3 Max 30 Dept_id Dept_name 1 Accounts 2 Production © wideskills.com

SQL syntax and query SQL is case in-sensitive, that is keyword SELECT and select is same for SQL. Every SQL command should end with a semi-colon (;). If the syntax is not proper, then executing the command would result in syntax error. Command used to fetch data from table is called as query. A basic SQL query consists of SELECT, FROM and WHERE clause. SQL SELECT Command example: SELECT col1, col2, col3,….. FROM table_name WHERE condition; © wideskills.com

Datatypes in SQL Data type is the attribute of the data expected in the column. Depending upon the SQL implementation (version) different data types are available. Whenever you create a column using the data type, the SQL Implementation program would allocate appropriate amount of space to store the data. Data types are broadly categorized into Numerics, Strings, Binary, Datetime, Collection and XML. Most commonly used data types are Integer, Decimal, Float, Character, Varchar, Boolean, Date. Example: Boolean Value : Return value = “True” INT : 5400, -2500 Numeric or Decimal: Decimal(4,2) = 1000.24 © wideskills.com

Operators and expressions in SQL In SQL, operators are used in an SQL statement’s WHERE clause to perform different operations like comparison, logical and arithmetic operations. Operators that can be used are logical, comparison and Arithmetic. The Operators include <,>,<>,AND,OR,BETWEEN,ISNULL,+,-,?,% etc. Generally in any programming language, expression is a combination of values, constants, variables, operators and functions that results in a value. In SQL, expressions are used to query database/table to get specific data. Syntax: SELECT cols|expressions FROM table_name WHERE condition(using operators|expressions); © wideskills.com

SQL commands can be used to create databases, edit data in tables, delete data and maintain data in tables. SQL commands are classified into 3 groups: DDL(Data definition Language), DML(Data Manipulation Language) and DCL(Data Control Language). DDL CREATE ALTER DROP CREATE INDEX DROP INDEX DML SELECT INSERT INTO UPDATE DELETE DCL GRANT REVOKE Let us start with CREATE… © wideskills.com

Create Database and Table As part of the Data Definition Language (DDL) under SQL, CREATE keyword is used to create databases and tables. One would need to first create Database and then under that database create the required tables. Syntax for creation of database: CREATE DATABASE database_name; The SQL CREATE TABLE statement allows you to create and define tables in a database. Syntax for creation of table: CREATE TABLE tablename ( column1 datatype NULL/NOT NULL, Column2 datatype NULL/NOT NULL ………………… PRIMARY KEY (column name or names), FOREIGN KEY(column name) REFERENCES Tablename(column name) ); WE will learn about Primary and Foreign key in the constraints slide… Optional © wideskills.com

Create Database and Table-1 Example Create employee table, which has a constraint on Department id of Departments table(i.e. value of department id in employee table depends on the value of Department id in Departments table). CREATE TABLE employee( Emp_ID INT NOT NULL, Emp_Name Varchar(20) NOT NULL, AGE INT NOT NULL, Phone_Num INT, Dept_ID INT NOT NULL, PRIMARY KEY(Emp_ID), FOREIGN KEY(DEPT_ID) REFERENCES DEPARTMENTS(DEPT_ID)); © wideskills.com

Interesting, right? This is just a sneak preview of the full presentation. We hope you like it! To see the rest of it, just click here to view it in full on PowerShow.com. Then, if you’d like, you can also log in to PowerShow.com to download the entire presentation for free.