
Introduction to SQL Phil Spector Introduction to SQL Phil Spector Statistical Computing Facility University of California, Berkeley Introduction to SQL I Structured Query Language I Usually “talk” to a database server I Used as front end to many databases (mysql, postgresql, oracle, sybase) I Three Subsystems: data description, data access and privileges I Optimized for certain data arrangements I The language is case-sensitive, but I use upper case for keywords. Introduction to SQL What is SQL? I Usually “talk” to a database server I Used as front end to many databases (mysql, postgresql, oracle, sybase) I Three Subsystems: data description, data access and privileges I Optimized for certain data arrangements I The language is case-sensitive, but I use upper case for keywords. Introduction to SQL What is SQL? I Structured Query Language I Used as front end to many databases (mysql, postgresql, oracle, sybase) I Three Subsystems: data description, data access and privileges I Optimized for certain data arrangements I The language is case-sensitive, but I use upper case for keywords. Introduction to SQL What is SQL? I Structured Query Language I Usually “talk” to a database server I Three Subsystems: data description, data access and privileges I Optimized for certain data arrangements I The language is case-sensitive, but I use upper case for keywords. Introduction to SQL What is SQL? I Structured Query Language I Usually “talk” to a database server I Used as front end to many databases (mysql, postgresql, oracle, sybase) I Optimized for certain data arrangements I The language is case-sensitive, but I use upper case for keywords. Introduction to SQL What is SQL? I Structured Query Language I Usually “talk” to a database server I Used as front end to many databases (mysql, postgresql, oracle, sybase) I Three Subsystems: data description, data access and privileges I The language is case-sensitive, but I use upper case for keywords. Introduction to SQL What is SQL? I Structured Query Language I Usually “talk” to a database server I Used as front end to many databases (mysql, postgresql, oracle, sybase) I Three Subsystems: data description, data access and privileges I Optimized for certain data arrangements Introduction to SQL What is SQL? I Structured Query Language I Usually “talk” to a database server I Used as front end to many databases (mysql, postgresql, oracle, sybase) I Three Subsystems: data description, data access and privileges I Optimized for certain data arrangements I The language is case-sensitive, but I use upper case for keywords. I Multiple simultaneous changes to data (concurrency) I Data changes on a regular basis I Large data sets where you only need some observations/variables I Share huge data set among many people I Rapid queries with no analysis I Web interfaces to data, especially dynamic data Introduction to SQL When do you need a Database? I Data changes on a regular basis I Large data sets where you only need some observations/variables I Share huge data set among many people I Rapid queries with no analysis I Web interfaces to data, especially dynamic data Introduction to SQL When do you need a Database? I Multiple simultaneous changes to data (concurrency) I Large data sets where you only need some observations/variables I Share huge data set among many people I Rapid queries with no analysis I Web interfaces to data, especially dynamic data Introduction to SQL When do you need a Database? I Multiple simultaneous changes to data (concurrency) I Data changes on a regular basis I Share huge data set among many people I Rapid queries with no analysis I Web interfaces to data, especially dynamic data Introduction to SQL When do you need a Database? I Multiple simultaneous changes to data (concurrency) I Data changes on a regular basis I Large data sets where you only need some observations/variables I Rapid queries with no analysis I Web interfaces to data, especially dynamic data Introduction to SQL When do you need a Database? I Multiple simultaneous changes to data (concurrency) I Data changes on a regular basis I Large data sets where you only need some observations/variables I Share huge data set among many people I Web interfaces to data, especially dynamic data Introduction to SQL When do you need a Database? I Multiple simultaneous changes to data (concurrency) I Data changes on a regular basis I Large data sets where you only need some observations/variables I Share huge data set among many people I Rapid queries with no analysis Introduction to SQL When do you need a Database? I Multiple simultaneous changes to data (concurrency) I Data changes on a regular basis I Large data sets where you only need some observations/variables I Share huge data set among many people I Rapid queries with no analysis I Web interfaces to data, especially dynamic data I Live Queries I Report Generation I Normalization, foreign keys, joins, etc. Newer uses: I Storage - data is extracted and analyzed in another application I Backends to web sites I Traditional rules may not be as important Introduction to SQL Uses of Databases Traditional Uses: I Report Generation I Normalization, foreign keys, joins, etc. Newer uses: I Storage - data is extracted and analyzed in another application I Backends to web sites I Traditional rules may not be as important Introduction to SQL Uses of Databases Traditional Uses: I Live Queries I Normalization, foreign keys, joins, etc. Newer uses: I Storage - data is extracted and analyzed in another application I Backends to web sites I Traditional rules may not be as important Introduction to SQL Uses of Databases Traditional Uses: I Live Queries I Report Generation Newer uses: I Storage - data is extracted and analyzed in another application I Backends to web sites I Traditional rules may not be as important Introduction to SQL Uses of Databases Traditional Uses: I Live Queries I Report Generation I Normalization, foreign keys, joins, etc. I Storage - data is extracted and analyzed in another application I Backends to web sites I Traditional rules may not be as important Introduction to SQL Uses of Databases Traditional Uses: I Live Queries I Report Generation I Normalization, foreign keys, joins, etc. Newer uses: I Backends to web sites I Traditional rules may not be as important Introduction to SQL Uses of Databases Traditional Uses: I Live Queries I Report Generation I Normalization, foreign keys, joins, etc. Newer uses: I Storage - data is extracted and analyzed in another application I Traditional rules may not be as important Introduction to SQL Uses of Databases Traditional Uses: I Live Queries I Report Generation I Normalization, foreign keys, joins, etc. Newer uses: I Storage - data is extracted and analyzed in another application I Backends to web sites Introduction to SQL Uses of Databases Traditional Uses: I Live Queries I Report Generation I Normalization, foreign keys, joins, etc. Newer uses: I Storage - data is extracted and analyzed in another application I Backends to web sites I Traditional rules may not be as important I console command (mysql -u user -p dbname) I GUI interfaces are often available I Interfaces to many programming languages: R, python, perl, PHP, etc. I SQLite - use SQL without a database server I PROC SQL in SAS Introduction to SQL Ways to Use SQL I GUI interfaces are often available I Interfaces to many programming languages: R, python, perl, PHP, etc. I SQLite - use SQL without a database server I PROC SQL in SAS Introduction to SQL Ways to Use SQL I console command (mysql -u user -p dbname) I Interfaces to many programming languages: R, python, perl, PHP, etc. I SQLite - use SQL without a database server I PROC SQL in SAS Introduction to SQL Ways to Use SQL I console command (mysql -u user -p dbname) I GUI interfaces are often available I SQLite - use SQL without a database server I PROC SQL in SAS Introduction to SQL Ways to Use SQL I console command (mysql -u user -p dbname) I GUI interfaces are often available I Interfaces to many programming languages: R, python, perl, PHP, etc. I PROC SQL in SAS Introduction to SQL Ways to Use SQL I console command (mysql -u user -p dbname) I GUI interfaces are often available I Interfaces to many programming languages: R, python, perl, PHP, etc. I SQLite - use SQL without a database server Introduction to SQL Ways to Use SQL I console command (mysql -u user -p dbname) I GUI interfaces are often available I Interfaces to many programming languages: R, python, perl, PHP, etc. I SQLite - use SQL without a database server I PROC SQL in SAS I A database server can contain many databases I Databases are collections of tables I Tables are two-dimensional with rows (observations) and columns (variables) I Limited mathematical and summary operations available I Very good at combining information from several tables Introduction to SQL Some Relational Database Concepts I Databases are collections of tables I Tables are two-dimensional with rows (observations) and columns (variables) I Limited mathematical and summary operations available I Very good at combining information from several tables Introduction to SQL Some Relational Database Concepts I A database server can contain many databases I Tables are two-dimensional with rows (observations) and columns (variables) I Limited mathematical and summary operations available I Very good at combining information from several tables Introduction to SQL Some Relational Database Concepts I A database server can contain many databases I Databases are collections
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages165 Page
-
File Size-