1 / 5

S tructured Q uery L anguage - SQL

S tructured Q uery L anguage - SQL. Industry standard data access language Developed by a number of companies in the 80’s However, there are slight variations in using SQL each RDBMS SQL types: DDL – data definition language Used by DBAs and developers to create db objects.

artan
Download Presentation

S tructured Q uery L anguage - SQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Structured Query Language - SQL • Industry standard data access language • Developed by a number of companies in the 80’s • However, there are slight variations in using SQL each RDBMS • SQL types: • DDL – data definition language • Used by DBAs and developers to create db objects. • Used to create BI objects • DML – data manipulation language • Used by DBAs, developers, and power users to access data in databases. • Used to retrieve data from a data warehouse.

  2. SQL - DML • Based on a command (CRUD), data, criteria: • Commands: select, insert, update, delete • Data: lists the table and views to be utilized • Criteria: limits the subset of the data • Examples: • Select * from customer • retrieves all rows and columns from a customer table • Select ID, name from customer where customer id = 15 • retrieves customer 15’s id and name • Select distinct order id from order line • Retrieve an unduplicated list of orders

  3. SQL - Criteria • Where clause • Limit the subset of data accessed • Select * from faculty where course id = ‘isom445’ • Join tables • Select student name from student, enrollment where course id = ‘isom445’ and student.student ID = enrollment.student id

  4. SQL Operators • Multiple criteria may be linked with and / or: • Where customer id = 15 and product color = red • Where customer id = 15 or product color = red • Criteria may use and & or: • Where customer id = 15 or (customer id = 12 and color = red)

  5. SQL Sorting and Grouping • Order By – clause: • Order by city, state • Ascending (asc) or descending (desc) • Group By – clause: • Summarize data on the group by column • Select count(*) from customer group by state • May apply functions on whole set or subset of the data • Average • Sum

More Related