SQL pepper.

Slides:



Advertisements
Similar presentations
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Advertisements

Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2010 All Rights Reserved. 1.
Structured Query Language SQL: An Introduction. SQL (Pronounced S.Q.L) The standard user and application program interface to a relational database is.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
Phil Brewster  One of the first steps – identify the proper data types  Decide how data (in columns) should be stored and used.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
CSCI 6962: Server-side Design and Programming
Session 5: Working with MySQL iNET Academy Open Source Web Development.
INTERNET APPLICATION DEVELOPMENT For More visit:
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Databases in Visual Studio. Database in VisualStudio An MS SQL database are built in Visual studio The Name can be something like ”(localdb)\Projects”
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
Introduction to MySQL Lab no. 10 Advance Database Management System.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Database and mySQL Week 07 Dynamic Web TCNJ Jean Chu.
Database Fred Durao What is a database? A database is any organized collection of data. Some examples of databases you may encounter in.
CPS120: Introduction to Computer Science Lecture 19 Introduction to SQL.
Relational Databases Database Driven Applications Retrieving Data Changing Data Analysing Data What is a DBMS An application that holds the data manages.
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2015, Fred McClurg, All Rights.
Chapter 10: The Data Tier We discuss back-end data storage for Web applications, relational data, and using the MySQL database server for back-end storage.
Chapter 5 MYSQL Database. Introduction to MYSQL MySQL is the world's most popular open-source database. Open source means that the source code, the programming.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Visual Programing SQL Overview Section 1.
CS453: Databases and State in Web Applications (Part 2) Prof. Tom Horton.
Chapter 8 Manipulating MySQL Databases with PHP PHP Programming with MySQL 2 nd Edition.
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
CP476 Internet Computing Perl CGI and MySql 1 Relational Databases –A database is a collection of data organized to allow relatively easy access for retrievals,
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
1 CPE 332 Introduction DBMS: Relational Database Managment Systems Instructor:Suthep Madarasmi, Ph.D. ดร. สุเทพ มาดารัศมี
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
Databases and SQL CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
Lec-7. The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax SELECT column_name(s) FROM table_name WHERE.
 MySQL is a database system used on the web  MySQL is a database system that runs on a server  MySQL is ideal for both small and large applications.
Chapter 12 Introducing Databases. Objectives What a database is and which databases are typically used with ASP.NET pages What SQL is, how it looks, and.
SQL Introduction SQL stands for “Structured Query Language” and can be pronounced as “SQL” or “sequel – (Structured English.
3 A Guide to MySQL.
Web Systems & Technologies
Databases.
Chapter 5 Introduction to SQL.
CS320 Web and Internet Programming SQL and MySQL
Data Definition and Data Types
Ch. 3. MySQL (이 강의의 대부분 예는 tutorialspoint. com/mysql/index
CS311 Database Management system
Principles of Software Development
Using SQL Server through Command Prompt
Database Management  .
ISC440: Web Programming 2 Server-side Scripting PHP 3
Chapter 7 Working with Databases and MySQL
Chapter 8 Working with Databases and MySQL
Introduction To Structured Query Language (SQL)
CS122 Using Relational Databases and SQL
Introduction To Structured Query Language (SQL)
Tutorial 6 PHP & MySQL Li Xu
CS3220 Web and Internet Programming SQL and MySQL
CS1222 Using Relational Databases and SQL
Data Definition Language
Data Definition Language
MySQL Database System Installation Overview SQL summary
CS3220 Web and Internet Programming SQL and MySQL
MySQL Database System Installation Overview SQL summary
CS122 Using Relational Databases and SQL
CS4540 Special Topics in Web Development SQL and MS SQL
Presentation transcript:

SQL pepper

Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation File locking Security concerns Much more

Different SQL Servers Mysql (open source – no cost to use though may cost to embed and resell outside gpl) Ms sql (microsoft ) Oracle Sybase Access Older AS/400 – SQL machine

Structure SQL Server runs a service accepts sql commands using their version of the standard query language Allows access to the data inside the SQL server Organized into databases Tables (like spreadsheets) inside databases Gui management interface Access / mysql workbench / mssql studio mgr

Your databases Connect with : mysql -u yourdbuser -p yourdatabase The –p means the password will be entered later. You can also put the password right after the p as in pmypassword. No spaces and no quotes Your database name is your db user and is usually your ecampus logon name You should also be able to connect to pepperdb See your tables show tables See information inside your table select * from tablename

Create a table CREATE TABLE table_name (column_name column_type ); Plus insert PRIMARY KEY ( tutorial_id ) at end Ex: create table tutorials_tbl( tutorial_id INT NOT NULL AUTO_INCREMENT, tutorial_title VARCHAR(100) NOT NULL, tutorial_type VARCHAR(40) NOT NULL, submission_date DATE, PRIMARY KEY ( tutorial_id ) ); Credit to : http://www.tutorialspoint.com/mysql/mysql-create-tables.htm

Create a table simpler CREATE TABLE table_name (column_name column_type ); Plus insert PRIMARY KEY ( tutorial_id ) at end Ex: create table tutorials_tbl( tutorial_id INT , tutorial_title VARCHAR(100) , tutorial_type VARCHAR(40) ); Credit to : http://www.tutorialspoint.com/mysql/mysql-create-tables.htm

Create a related table Create table tutorials_types ( type VARCHAR(40) NOT NULL, type_name VARCHAR(100) NOT NULL, type_manager int not null, PRIMARY KEY ( type) ); Table picture from wikipedia

Insert a row INSERT INTO table_name ( field1, field2,...fieldN ) VALUES ( value1, value2,...valueN ); Examples: INSERT INTO tutorials_tbl (tutorial_title, tutorial_type, submission_date) VALUES ("Learn PHP", "php",NOW()); INSERT INTO tutorials_tbl (tutorial_title, tutorial_type, submission_date) VALUES ("Learn MySQL", "db",NOW()); INSERT INTO tutorials_tbl (tutorial_title, tutorial_type, submission_date) VALUES ("Learn Oracle", "db",NOW()); Credit: http://www.tutorialspoint.com/mysql/mysql-insert-query.htm

Insert rows into another table INSERT INTO tutorials_types values ("php", "php tutorials",10); INSERT INTO tutorials_types values ("db", "database tutorials",20);

Query your tables select * from tutorials_tbl; select * from tutorials_types; select * from tutorials_types inner join tutorials_tbl on tutorials_tbl.tutorial_type = tutorials_types.type;

Select statement Select – keyword indicating just looking List all columns (* for all; table.column) From – keyword indicating table names follow Table name Join type + next table + on + matching fields Where – keyword indicating row selection Column = something

Switch to another database Show databases Use <database name>

Summary What is SQL How to open a database How to create tables How to query tables – very, very basic How to switch database context