2009.10.13 SLIDE 1IS 257 – Fall 2009 More on MySQL and SQL University of California, Berkeley School of Information IS 257: Database Management.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
SLIDE 1IS 257 – Fall 2006 Coldfusion and PHP introduction University of California, Berkeley School of Information IS 257: Database Management.
Oct. 12, 2000Database Management -- R. Larson Web-Enabled Databases and Search Engines University of California, Berkeley School of Information Management.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
SLIDE 1IS Fall 2002 ORACLE SQL and SQL_PLUS University of California, Berkeley School of Information Management and Systems SIMS 257:
SLIDE 1IS Fall 2011 Database Administration: Security and Integrity University of California, Berkeley School of Information IS 257:
SLIDE 1IS 257 – Fall 2006 Coldfusion and PHP introduction University of California, Berkeley School of Information IS 257: Database Management.
SLIDE 1IS Fall 2002 Database Applications: Web-Enabled Databases and Search Engines University of California, Berkeley School of Information.
Oct. 11, 2001Database Management -- R. Larson Database Applications: Web-Enabled Databases and Search Engines University of California, Berkeley School.
SLIDE 1IS Fall 2002 PHP (and MySQL) University of California, Berkeley School of Information Management and Systems SIMS 257: Database.
SLIDE 1IS 257 – Fall 2010 PHP introduction University of California, Berkeley School of Information IS 257: Database Management.
10/28/1999Database Management -- R. Larson ORACLE SQLPlus Updating and Modifying Data In SQL University of California, Berkeley School of Information Management.
10/17/2000Database Management -- R. Larson Data Administration and Database Administration University of California, Berkeley School of Information Management.
SLIDE 1IS 202 – FALL 2002 Prof. Ray Larson & Prof. Marc Davis UC Berkeley SIMS Tuesday and Thursday 10:30 am - 12:00 pm Fall 2002
Database Applications: Web-Enabled Databases and Search Engines
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
SLIDE 1IS 257 – Fall 2004 ORACLE and SQLPlus University of California, Berkeley School of Information Management and Systems SIMS 257: Database.
SLIDE 1IS 257 – Fall 2006 More on SQL (and MySQL) University of California, Berkeley School of Information IS 257: Database Management.
SLIDE 1IS 257 – Fall 2005 More on SQL (and MySQL) University of California, Berkeley School of Information Management and Systems SIMS 257:
SLIDE 1IS 257 – Spring 2005 Database Applications and Web-Enabled Databases University of California, Berkeley School of Information Management.
SLIDE 1IS Fall 2010 Database Administration: Security and Integrity University of California, Berkeley School of Information IS 257:
SLIDE 1IS 257 – Spring 2004 Database Applications and Introduction to ColdFusion and PHP University of California, Berkeley School of Information.
SLIDE 1IS 257 – Spring 2004 PHP (and MySQL) University of California, Berkeley School of Information Management and Systems SIMS 257: Database.
Oct. 16, 2001Database Management -- R. Larson Database Applications: Web-Enabled Databases and Search Engines: Cont. University of California, Berkeley.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
SLIDE 1IS Fall 2002 Database Applications: Using ColdFusion University of California, Berkeley School of Information Management and Systems.
SLIDE 1IS 257 – Fall 2014 Database Applications and Web-Enabled Databases University of California, Berkeley School of Information IS 257:
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
SLIDE 1IS 257 – Fall 2013 JDBC and Java Access to DBMS MySQLdb and Python Access to MySQL University of California, Berkeley School of Information.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
How the Web Works. WWW – part of the Internet (others: , FTP, Telnet) Loaded to a Server | Viewed in a Browser (Client) Client: Request & Render.
SLIDE 1IS 257 – Fall 2014 PHP introduction University of California, Berkeley School of Information IS 257: Database Management.
Programming with php By: Seth Larson. A little bit about PHP  PHP stands for PHP:  Hypertext Preprocessor  PHP is a widely-used general-purpose server-side.
© Yanbu University College YANBU UNIVERSITY COLLEGE Management Science Department © Yanbu University College Module 6:WEB SERVER AND SERVER SIDE SCRPTING,
PHP H ypertext P re-processor. Unit 6 - PHP - Hello World! - Data types - Control structures - Operators.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 19: Database Support.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Mark Dixon Page 1 23 – Web applications: Writing data to Databases using PhP.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
FUNCTIONS AND STORED PROCEDURES & FUNCTIONS AND PROTECTING A DB AND PHP (Chapters 9, 15, 18)
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Introduction to ColdFusion Yu Fu 2003 MEC Candidate.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
PHP and JavaScript Nov. 26, 2013 Kyung Eun Park Computer and Creativity (COSC109) Towson University.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Web Development Process The Site Development Process Site Construction is one of the last steps.
IT ELECTIVE 2.  Web server Can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that.
Accessing mySQL relational database. MySQL database.  Today, we will attempt and open a connection to the MySQL server.  We need to specify the database.
SLIDE 1IS Fall 2012 Database Administration: Security and Integrity University of California, Berkeley School of Information IS 257:
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
Introduction and Principles
PHP / MySQL Introduction
ISC440: Web Programming 2 Server-side Scripting PHP 3
Coldfusion and PHP introduction
Database Administration: Security and Integrity
IntroductionToPHP Static vs. Dynamic websites
Tutorial 6 PHP & MySQL Li Xu
Presentation transcript:

SLIDE 1IS 257 – Fall 2009 More on MySQL and SQL University of California, Berkeley School of Information IS 257: Database Management

SLIDE 2IS 257 – Fall 2009 Lecture Outline Review –ColdFusion –PHP More on MySQL and SQL

SLIDE 3IS 257 – Fall 2009 Lecture Outline Review –ColdFusion –PHP More on MySQL and SQL

SLIDE 4IS 257 – Fall 2009 Templates Assume we have a database named contents_of_my_shopping_cart.mdb -- single table called contents... Create an HTML page (uses extension.cfm), and before...

SLIDE 5IS 257 – Fall 2009 Templates cont. SELECT * FROM contents ; Contents of My Shopping Cart Contents of My Shopping Cart #Item# #Date_of_item# $#Price#

SLIDE 6IS 257 – Fall 2009 Templates cont. Contents of My Shopping Cart Bouncy Ball with Psychedelic Markings 12 December 1998 $0.25 Shiny Blue Widget 14 December 1998 $2.53 Large Orange Widget 14 December 1998 $3.75

SLIDE 7IS 257 – Fall 2009 CFIF and CFELSE Item: #Item#

SLIDE 8IS 257 – Fall 2009 More Templates INSERT INTO Employees(firstname, lastname, phoneext) VALUES(‘#firstname#’, ‘#lastname#’, ‘#phoneext#’) Employee Added Employee #firstname# #lastname# added.

SLIDE 9IS 257 – Fall 2009 CFML ColdFusion Markup Language Read data from and update data to databases and tables Create dynamic data-driven pages Perform conditional processing Populate forms with live data Process form submissions Generate and retrieve messages Perform HTTP and FTP function Perform credit card verification and authorization Read and write client-side cookies

SLIDE 10IS 257 – Fall 2009 Lecture Outline Review –ColdFusion –PHP More on MySQL and SQL

SLIDE 11IS 257 – Fall 2009 PHP PHP is an Open Source Software project with many programmers working on the code. –Commonly paired with MySQL, another OSS project –Free –Both Windows and Unix support Estimated that more than 250,000 web sites use PHP as an Apache Module.

SLIDE 12IS 257 – Fall 2009 PHP Syntax Similar to “C” or Java (note lines end with “;”) Includes most programming structures (Loops, functions, Arrays, etc.) Loads HTML form variables so that they are addressable by name <?php $myvar = “Hello World”; echo $myvar ; ?>

SLIDE 13IS 257 – Fall 2009 Combined with MySQL DBMS interface appears as a set of functions: <?php $db = mysql_connect(“localhost”, “root”); mysql_select_db(“mydb”,$db); $result = mysql_query(“SELECT * FROM employees”, $db); Printf(“First Name: %s \n”, mysql_result($result, 0 “first”); Printf(“Last Name: %s \n”, mysql_result($result, 0 “last”); ?>

SLIDE 14IS 257 – Fall 2009 Lecture Outline Review –ColdFusion –PHP More on MySQL and SQL

SLIDE 15IS 257 – Fall 2009 Today More on SQL for data manipulation and modification

SLIDE 16IS 257 – Fall 2009 SELECT Syntax: –SELECT [DISTINCT] attr1, attr2,…, attr3 as label, function(xxx), calculation, attr5, attr6 FROM relname1 r1, relname2 r2,… rel3 r3 WHERE condition1 {AND | OR} condition2 ORDER BY attr1 [DESC], attr3 [DESC]

SLIDE 17IS 257 – Fall 2009 SELECT Conditions = equal to a particular value >= greater than or equal to a particular value > greater than a particular value <= less than or equal to a particular value <> or != not equal to a particular value LIKE ‘%wom_n%’ (Note different wild card from Access) opt1 SOUNDS LIKE opt2 IN (‘opt1’, ‘opt2’,…,’optn’) BETWEEN opt1 AND opt2 IS NULL or IS NOT NULL

SLIDE 18IS 257 – Fall 2009 Aggregate (group by) Functions COUNT(dataitem) COUNT(DISTINCT expr) AVG(numbercolumn) SUM(numbercolumn) MAX(numbercolumn) MIN(numbercolumn) STDDEV(numbercolumn) VARIANCE(numbercolumn) and other variants of these…

SLIDE 19IS 257 – Fall 2009 Numeric Functions ABS(n) ACOS(n) ASIN(n) ATAN(n) ATAN2(n, m) CEIL(n) COS(n) COSH(n) CONV(n, f- base,t-base) COT(n) ROUND(n) SIGN(n) SIN(n) SINH(n) SQRT(n) TAN(n) TANH(n) TRUNCATE( n,m) DEGREES(n) EXP(n) FLOOR(n) LN(n) LOG(n,b) MOD(n) PI() POWER(n,p)

SLIDE 20IS 257 – Fall 2009 Character Functions returning character values CHAR(n,…) CONCAT(str1,str2,…) LOWER(char) LPAD(char, n,char2), RPAD(char, n,char2) LTRIM(char, n, cset), RTRIM(char, n, cset) REPLACE(char, srch, repl) SOUNDEX(char) SUBSTR(char, m, n) UPPER(char)

SLIDE 21IS 257 – Fall 2009 Character Function returning numeric values ASCII(char) INSTR(char1, char2) LENGTH(char) BIT_LENGTH(str) CHAR_LENGTH(str) LOCATE(substr,str) LOCATE(substr,str,po s) and many other variants.

SLIDE 22IS 257 – Fall 2009 Date functions ADDDATE(dt, INTERVAL expr unit) or ADDDATE(dt, days) ADDTIME(dttm, time) LAST_DAY(dt) MONTH(dt) – YEAR(dt) – DAY(dt) MONTHNAME(dt) NOW() NEW_TIME(d, z1, z2) -- PST, AST, etc. NEXT_DAY(d, dayname) STR_TO_DATE(str,format) SYSDATE()

SLIDE 23IS 257 – Fall 2009 Demo Setting up Diveshop on MySQL SQL Queries for Assignment 3 MySQL and XML