EE 495M - Lecture 3. Overview

Size: px
Start display at page:

Download "EE 495M - Lecture 3. Overview"

Transcription

1 EE 495M - Lecture 3 mysql and PHP Mustafa Kamasak September 10, 2003 Overview Database Tier (MySQL) SQL Logic Tier (PHP) Web Server Presentation Tier (Browsers) MySQL SQL PHP MySQL & PHP interface

2 MySQL - Basics To start mysql type mysql -u username -p and enter your password when prompted. A commandline interface will be started. $ mysql -u ims -p Starting MySQL as user IMS Enter password: Welcome to the MySQL monitor. Commands end with ; or \\g. Your MySQL connection id is to server version: Type help; or \\h for help. Type \\c to clear the buffer. mysql> show databases will show the list of the databases in the server. mysql> show databases; Database test1 test rows in set (0.00 sec) mysql> MySQL - Basics To create a new database use create database dbname mysql> CREATE DATABASE ee495m; Query OK, 1 row affected (0.00 sec) mysql> show databases; Database ee495m test1 test rows in set (0.00 sec) To select a database type use dbname To see the tables inside this database use show tables mysql> USE ee495m Database changed mysql> SHOW TABLES; Empty set (0.00 sec) mysql>

3 MySQL - Tables To create a new table CREATE TABLE table_name (column1_name type [modifiers],...) mysql> CREATE TABLE students(student_id INT(9) NOT NULL PRIMARY KEY, -> FIRST_NAME VARCHAR(30), -> LAST_NAME VARCHAR(30), -> PROJECT VARCHAR(10) NOT NULL); Query OK, 0 rows affected (0.00 sec) mysql> Column types BIGINT BLOB CHAR CHARACTER CHARACTER VARYING DATE DATETIME DEC DECIMAL DOUBLE DOUBLE PRECISION ENUM FLOAT INT INTEGER LONGBLOB LONGTEXT MEDIUMBLOB MEDIUMINT MEDIUMTEXT NCHAR NATIONAL CHAR NATIONAL CHARACTER NATIONAL VARCHAR NUMERIC REAL SET SMALLINT TEXT TIME TIMESTAMP TINYBLOB TINYINT TINYTEXT VARCHAR YEAR MySQL - Basic Column Types The M is the display width and D is the number of digits after decimal point. INT[(M)] [UNSIGNED] A normal-size integer. The signed range is to The unsigned range is 0 to CHAR(M) A fixed-length string that is always right-padded with spaces to the specified length when stored. The range of M is 0 to 255 characters. VARCHAR(M) Values in VARCHAR columns are variable-length strings. You can declare a VARCHAR column to be any length between 1 and 255, just as for CHAR columns. Trailing spaces are removed when values are stored. FLOAT[(M,D)] [UNSIGNED] A small (single-precision) floating-point number. DOUBLE[(M,D)] [UNSIGNED] A normal-size (double-precision) floating-point number. DATE A date. The supported range is to TIME A time. The range is -838:59:59 to 838:59:59.

4 To see the fields of a table DESCRIBE table_name MySQL - Table Modifications mysql> describe students; Field Type Null Key Default Extra STUDENT_ID int(9) PRI 0 FIRST_NAME varchar(30) YES NULL LAST_NAME varchar(30) YES NULL PROJECT varchar(10) 4 rows in set (0.00 sec) If a table structure needs to be modified ALTER TABLE table_name action_list mysql> ALTER TABLE students ADD COLUMN (PHONE CHAR(13)); Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> describe students; Field Type Null Key Default Extra STUDENT_ID int(9) PRI 0 FIRST_NAME varchar(30) YES NULL LAST_NAME varchar(30) YES NULL PROJECT varchar(10) PHONE varchar(13) YES NULL 5 rows in set (0.00 sec) Modify column type MySQL - Table Modifications mysql> ALTER TABLE students MODIFY PROJECT varchar(15); Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> describe students; Field Type Null Key Default Extra STUDENT_ID int(9) PRI 0 FIRST_NAME varchar(30) YES NULL LAST_NAME varchar(30) YES NULL PROJECT varchar(15) YES NULL PHONE varchar(13) YES NULL 5 rows in set (0.00 sec) Delete a column mysql> ALTER TABLE students DROP PHONE; Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> describe students; Field Type Null Key Default Extra STUDENT_ID int(9) PRI 0 FIRST_NAME varchar(30) YES NULL LAST_NAME varchar(30) YES NULL PROJECT varchar(15) YES NULL 4 rows in set (0.00 sec)

5 MySQL - Deleting Change Table Name mysql> ALTER TABLE students RENAME TO alumni; Delete Column mysql> ALTER TABLE students DROP COLUMN column_name; Delete Table mysql> DROP TABLE table_name; Delete Database mysql> DROP DATABASE db_name; SQL - Structured Query Language To insert data into a table INSERT INTO table_name (columnk_name,...) VALUES (columnk_value,...) mysql> INSERT INTO students (STUDENT_ID,PROJECT) VALUES ( , eact ); Query OK, 1 row affected (0.00 sec) To see the contents of a table SELECT column_name(s) FROM table_name WHERE conditions mysql> SELECT * FROM students; STUDENT_ID FIRST_NAME LAST_NAME PROJECT NULL NULL eact row in set (0.00 sec)

6 SQL - Structured Query Language To update a record mysql> UPDATE table_name SET column_name=column_value WHERE conditions mysql> UPDATE students SET FIRST_NAME= John WHERE STUDENT_ID= ; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> SELECT * FROM students; STUDENT_ID FIRST_NAME LAST_NAME PROJECT John NULL eact rows in set (0.00 sec) To delete a record mysql>delete FROM table_name WHERE conditions mysql> delete from students; Query OK, 0 rows affected (0.01 sec) mysql> select * from students; Empty set (0.00 sec) SQL - Examples Initial Table mysql> SELECT * FROM students; STUDENT_ID FIRST_NAME LAST_NAME PROJECT John NULL EAct John Smith EPrint John1 Smith EAct Jr. John Smith EAct John Smith EPrint Ganesh Anand EAct Karl Hiedermann EAct Peter Harper EAct Arman Gucci EPrint rows in set (0.00 sec) Find the first names of EPrint team members mysql> SELECT FIRST_NAME FROM students WHERE PROJECT= EPrint ; FIRST_NAME John John Arman rows in set (0.01 sec)

7 SQL - Examples Ordering entries mysql> SELECT * FROM students ORDER BY STUDENT_ID; STUDENT_ID FIRST_NAME LAST_NAME PROJECT John NULL EAct John Smith EPrint John1 Smith EAct Jr. John Smith EAct John Smith EPrint Peter Harper EAct Karl Hiedermann EAct Ganesh Anand EAct Arman Gucci EPrint rows in set (0.00 sec) Delete all students that have Smith as their last name. mysql> DELETE FROM students WHERE LAST_NAME= Smith ; Query OK, 4 rows affected (0.00 sec) mysql> SELECT * FROM students; STUDENT_ID FIRST_NAME LAST_NAME PROJECT John NULL EAct Ganesh Anand EAct Karl Hiedermann EAct Peter Harper EAct Arman Gucci EPrint rows in set (0.00 sec) SQL - Examples A second table in ee495m database mysql> SELECT * FROM equipment; STUDENT_ID EQ Laptop pocketpc Laptop Laptop Network Card rows in set (0.00 sec) Find the first and last names of the students who got Laptop mysql> SELECT FIRST_NAME, LAST_NAME FROM students,equipment -> WHERE students.student_id = equipment.student_id -> AND equipment.eq = Laptop ; FIRST_NAME LAST_NAME Peter Harper Karl Hiedermann Ganesh Anand rows in set (0.01 sec)

8 SQL - Examples Find the equipment that is given to Peter Harper. mysql> SELECT EQ FROM students,equipment -> WHERE students.student_id = equipment.student_id -> AND students.first_name= Peter -> AND students.last_name= Harper ; EQ Laptop pocketpc Network Card rows in set (0.00 sec) PHP - Advantages PHP can be embedded into HTML files It is open source and has many open source libraries. Easy access to database servers

9 PHP - Introduction Simple hello.php <html> <head> <title>php Test</title> </head> <body> <?php echo "<p>hello World</p>";?> </body> </html> To begin script following tags can be used <script language="php"> PHP code </script> <?php PHP code?> <? PHP code?> Each PHP statement is terminated by a semicolon While spaces in the code is not important When a PHP script is executed the output of the script is replaced into the starting and ending tags PHP - Comments and Variables To comment PHP scripts following can be used // One line comment # Another one line comment /* Multi line comment */ PHP variables begin with $ sign followed by the variable name. Variables don t need to be declared. They have no type until they are assigned a value. $var = 15; // integer $var = 15.0; // float $var = "EE495M"; //string PHP four scaler types, boolean, float, integer and string - two compound types, array and object.

10 PHP - Arrays PHP provides array() to create arrays, for example $numbers=array(3,5,7,2); $la_liga_clubs=array("real Sociedad","Real Madrid","Valencia","Deportiva"); By default index for the first element starts from 0. Arrays can be created with different indexing. $numbers=array(1=>"one","two","three"); # Starts from index 1 $primes=array(2=>"two",3=>"three",5=>"five"); Strings can be used as indexes (keys). These arrays are called associative arrays. Multidimensional arrays can be created using nested array(). $points = array( array("x"=>0.77,"y"=>0.54,"z"=>0.2), array("x"=>0.37,"y"=>0.22,"z"=>0.32)); $points[1]["y"] = 0.22 PHP - Array Functions count(array) returns the number of elements in the array. min(array) and max(array) returns the minimum and maximum values in the array. in_array(element,array) returns true if the array contains element. array_reverse(array) reverses the order of array but preserves the associations. sort(array) and rsort(array) sorts the arrays in ascending and descending orders, respectively. $my_array = array(10,5,7,105,2); echo count($my_array); // 5 echo max($my_array); // 105 echo min($my_array); // 2 for ($i=0;$i<110;$i++) { if (in_array($i,$my_array)) { echo $i; // $new_array = reverse_array($my_array); echo $new_array[0]; // 2 $new_array = sort($my_array); echo $new_array[1]; // 5 $new_array = rsort($my_array); echo $new_array[1]; // 10

11 PHP - Expressions and Operators PHP Expressions $b = $a = 5; /* assign the value five into the variable $a and $b */ $c = $a++; /* post-increment, assign original value of $a */ $e = $d = ++$b; /* pre-increment, assign the incremented value of $b */ $f = double($d++); /* assign twice the value of $d before the increment */ $g = double(++$e); /* assign twice the value of $e after the increment */ $h = $g += 10; /* first, $g is incremented by 10 and the value of the assignment is then assigned into $h*/ PHP Operators Operator Description. string concatenation or, and, xor bitwise logical operators, &, ^ bitwise logical operators, && logical operators +,-,*,/,++,-- arithmetic operators <<,>> shifting operators ==,!=,!==,=== conditional operators Note === is a PHP specific operator. It returns true is both the values and types are equal, for example 5 === 5 // true 5.0 === 5 // false 5.0 == 5 // true PHP - Conditions and Branches if..else statement if ($var < 5) { echo "Variable is smaller than 5."; else { echo "Variable is bigger than 5 or equal to 5."; switch statement switch ($var) { case 1: echo "Variable is 1"; break; case 2: echo "Variable is 1"; break; default: echo "Variable is not 1 or 2";

12 PHP - Loops while and do..while $counter = 1; while ($counter<10) { echo "Counter is $counter"; $counter ++; do { echo "Counter is $counter"; $counter --; while ($counter>0); for for ($level=1,$lives=5;$level<15,$lives>0;$level++,$lives--) { // Do some stuff foreach $lengths = array(0,50,102,123); foreach ($lengths as $cm) { echo "$cm cm is $cm/2.45 inch."; PHP - Printing and Formatting Other than echo, integer printf(string format,arguments) and string sprintf(string format,arguments) can be used to print out a string or variable and to format a sting. The functions are almost same as C/C++. $counter=1; $days=array("mon","tue","wed","thu","fri","sat","sun"); while ($counter<8) { $today = sprintf("today is %s",$days[$counter]); printf("%d => %s\n",$counter,$today);

13 Functions are defined as follows PHP - User Defined Functions function square($num) { $sq = $num * $num; echo "Square of $num is $sq"; The argument and return types are not declared when the function is defined. function divide($a,$b) { return($a*$b); $c = divide(3,2); // c will be 1.5 By default arguments are passed by values. Arguments can be passed by reference as follows function double($a) { $a *= 2; function double1(&$a) { $a *=2; $a = 3; double($a); echo "$a"; // 3 double1($a); echo "$a"; // 6 Default arguments can be passed function divide($a,$b=2) { return($a/$b); $b=divide(5); // b will be 2.5 PHP - File IO To open a file use: fopen(string filename,string mode,int use_include_path); This function returns a handle to the file, which will used to access the file to read, write etc. If the file cannot be opened, it will return 0. Available modes are: Mode Access Type r Access the file for reading only. r+ Access the file for reading and writing. w Access the file for writing only. If the file exists, erase all contents. w+ Access the file for both reading and writing. If the file exists, erase all contents. a Open the file for writing only. If the file exists, access will start from the end of the file. a+ Open the file for reading and writing. If the file exists, access will start from the end of the file. If use_include_path is true and the file cannot be found in the specified directory, an attempt will be made to find the file in the directories specified by the PHP s include path.

14 PHP - File IO To read from the file: fgets(int file_handle,int length); the file_handle is the number returned by fopen function and the length is the number of bytes requested from the file. If length is skipped it will return a line from the file until EOF is reached. It will return the string read from the file or false if an error occurs. To write to the file: fputs(int file_handle,string str,int length); Returns the number of bytes written or -1 if an error occurs. To close the file: fclose(int file_handle); Other PHP functions for file IO. feof fflush fgetc file_exists filesize fileperms fread fscanf fseek ftell fstat fwrite PHP - File IO Example Simple web counter <? $visitors = 0; $fp = fopen( counter.txt, r ); if (!$fp) { $visitors = 1; $fp = fopen( counter.txt, w ); if (!$fp) { echo "Cannot open counter.txt"; exit; fputs($fp,$visitors); fclose($fp); else { $visitors = fgets($fp); $visitors ++; echo "This page have been visited $visitors time."; fclose($fp);?> $fp = fopen( counter.txt, w ); if (!$fp) { echo "Cannot open counter.txt"; exit; fputs($fp,$visitors); fclose($fp);

15 MySQL & PHP Basic PHP connection to a MySQL server consists of five steps: Connect the database resource mysql_connect(string hostname,string username, string password); The function returns a connection resource handle on success that will be used to access database, returns false on failure. Selecting a database int mysql_select_db(string database,resource connection); Executing SQL query resource mysql_query(string query,resource connection); Returns a result handle that will be used to fetch the result. Fetch the results of the query array mysql_fetch_row(resource result)) Returns an array of one row from the query result. It returns false when there is no more rows available. Close the connection int mysql_close(resource connection Index.php <HTML> <? if (!($connection = mysql_connect("localhost","foo","hardtofind"))) { die("cannot connect to database"); if (!mysql_select_db("ee495m",$connection)) { die("error ". mysql_errorno().": ". mysql_error()); $query = "SELECT FIRST_NAME,LAST_NAME,EQ FROM students,equipment WHERE students.student_id=equipment.student_id ORDER BY FIRST_NAME"; if (!($result = mysql_query($query,$connection))) { die("cannot connect to database"); print("<table BORDER>\n"); printf("<tr><td>name</td><td>equipment</td></tr>\n"); while ($row = mysql_fetch_array($result)) { printf ("<TR><TD> %s %s</td><td> %s</td></tr>\n", $row[0], $row[1],$row[2]); printf("</table>\n"); if (!mysql_close($connection)) { die("error ". mysql_errorno().": ". mysql_error());?> </HTML>

16 MySQL & PHP - Frequently used functions array mysql_fetch_array(resource,int) This function is extended version of mysql_fetch_row() It can fetch the results of a query as an associative array. Second parameter controls whether associative access (MYSQL_ASSOC) or numeric access (MYSQL_NUM) or both (MYSQL_BOTH) on the returned object. object mysql_fetch_object(resource,int) Instead of fetching an array this function fetches the result of a query as an object that can be accessed by column names. $object = mysql_fetch_object($result,mysql_both); echo $object->first_name; echo $object->eq; int mysql_free_result(resource) Normally memory buffered for the result of a query is released when the script ends. But if multiple queries need to be done in a script the resources used for the results must be freed. int mysql_num_rows(resource) This function returns the number of rows associated with the result of a query. A complete list of mysql functions can be found at Homework - Due September 17, 2003 Assume that, mysql server is installed on your localhost and you can access it with the following login and password: login: ee495 password: doesntmatter There is a database in this server called worldcup2002. It has three tables: teams games scorers

17 Homework Posted at: mobility/homeworks/hw2.html The description of these tables are as follows: mysql> describe teams; Field Type Null Key Default Extra team_id int(3) PRI NULL auto_increment name varchar(50) YES NULL rows in set (0.00 sec) mysql> describe games; Field Type Null Key Default Extra game_id int(3) PRI NULL auto_increment team1 int(3) YES NULL team2 int(3) YES NULL score varchar(10) YES NULL rows in set (0.00 sec) mysql> describe scorer; Field Type Null Key Default Extra name varchar(30) YES NULL team_id int(3) YES NULL game_id int(3) YES NULL goals int(3) YES NULL rows in set (0.00 sec) Homework The initial contents of these tables are given on the web site. Write hw1.php that will connect the mysql server and find all games of Turkey and list them (games+scores) with the scorers in those games. Format the output into a HTML table, eg. Team1 Team 2 Score Goals Brazil Turkey 2-1 Hasan Sas, Ronaldo, Rivaldo Write hw2.php that will connect the mysql server and find all games that Ronaldo OR Rivaldo scored and list them. Format the output into a HTML table. Scorer Team1 Team2 goals Ronaldo Brazil Turkey How to return: Use Winzip to compress all php files, name it Your Last Name.zip and it to mobility@ecn.purdue.edu. The subject of the should be: TEAM NAME HW 2.

18 References References [1] [2] [3] Managing and Using MySQL, G. Reese, R. Yarger and T. King, O Reilly. [4] Web and Database Applications with PHP and MySQL, H. Williams and D. Lane, O Reilly.

Lab # 2 Hands-On. DDL Basic SQL Statements Institute of Computer Science, University of Tartu, Estonia

Lab # 2 Hands-On. DDL Basic SQL Statements Institute of Computer Science, University of Tartu, Estonia Lab # 2 Hands-On DDL Basic SQL Statements Institute of Computer Science, University of Tartu, Estonia Part A: Demo by Instructor in Lab a. Data type of MySQL b. CREATE table c. ALTER table (ADD, CHANGE,

More information

Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018

Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018 Introduction to SQL on GRAHAM ED ARMSTRONG SHARCNET AUGUST 2018 Background Information 2 Background Information What is a (Relational) Database 3 Dynamic collection of information. Organized into tables,

More information

TINYINT[(M)] [UNSIGNED] [ZEROFILL] A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.

TINYINT[(M)] [UNSIGNED] [ZEROFILL] A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255. MySQL: Data Types 1. Numeric Data Types ZEROFILL automatically adds the UNSIGNED attribute to the column. UNSIGNED disallows negative values. SIGNED (default) allows negative values. BIT[(M)] A bit-field

More information

Data Types in MySQL CSCU9Q5. MySQL. Data Types. Consequences of Data Types. Common Data Types. Storage size Character String Date and Time.

Data Types in MySQL CSCU9Q5. MySQL. Data Types. Consequences of Data Types. Common Data Types. Storage size Character String Date and Time. - Database P&A Data Types in MySQL MySQL Data Types Data types define the way data in a field can be manipulated For example, you can multiply two numbers but not two strings We have seen data types mentioned

More information

The M in LAMP: MySQL CSCI 470: Web Science Keith Vertanen Copyright 2014

The M in LAMP: MySQL CSCI 470: Web Science Keith Vertanen Copyright 2014 The M in LAMP: MySQL CSCI 470: Web Science Keith Vertanen Copyright 2014 MySQL Setup, using console Data types Overview Creating users, databases and tables SQL queries INSERT, SELECT, DELETE WHERE, ORDER

More information

Overview of MySQL Structure and Syntax [2]

Overview of MySQL Structure and Syntax [2] PHP PHP MySQL Database Overview of MySQL Structure and Syntax [2] MySQL is a relational database system, which basically means that it can store bits of information in separate areas and link those areas

More information

More MySQL ELEVEN Walkthrough examples Walkthrough 1: Bulk loading SESSION

More MySQL ELEVEN Walkthrough examples Walkthrough 1: Bulk loading SESSION SESSION ELEVEN 11.1 Walkthrough examples More MySQL This session is designed to introduce you to some more advanced features of MySQL, including loading your own database. There are a few files you need

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #10: Open Office Base, Life on the Console, MySQL Database Design and Web Implementation

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #15: Post Spring Break Massive MySQL Review Database Design and Web Implementation

More information

MySQL Creating a Database Lecture 3

MySQL Creating a Database Lecture 3 MySQL Creating a Database Lecture 3 Robb T Koether Hampden-Sydney College Mon, Jan 23, 2012 Robb T Koether (Hampden-Sydney College) MySQL Creating a DatabaseLecture 3 Mon, Jan 23, 2012 1 / 31 1 Multiple

More information

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity]

What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] What is MySQL? [Document provides the fundamental operations of PHP-MySQL connectivity] MySQL is a database. A database defines a structure for storing information. In a database, there are tables. Just

More information

Module 3 MySQL Database. Database Management System

Module 3 MySQL Database. Database Management System Module 3 MySQL Database Module 3 Contains 2 components Individual Assignment Group Assignment BOTH are due on Mon, Feb 19th Read the WIKI before attempting the lab Extensible Networking Platform 1 1 -

More information

Chapter 8 How to work with data types

Chapter 8 How to work with data types Chapter 8 How to work with data types Murach's MySQL, C8 2015, Mike Murach & Associates, Inc. Slide 1 Objectives Applied Code queries that convert data from one data type to another. Knowledge Describe

More information

Chapter 3 Introduction to relational databases and MySQL

Chapter 3 Introduction to relational databases and MySQL Chapter 3 Introduction to relational databases and MySQL Murach's PHP and MySQL, C3 2014, Mike Murach & Associates, Inc. Slide 1 Objectives Applied 1. Use phpmyadmin to review the data and structure of

More information

Data and Tables. Bok, Jong Soon

Data and Tables. Bok, Jong Soon Data and Tables Bok, Jong Soon Jongsoon.bok@gmail.com www.javaexpert.co.kr Learning MySQL Language Structure Comments and portability Case-sensitivity Escape characters Naming limitations Quoting Time

More information

MySQL: an application

MySQL: an application Data Types and other stuff you should know in order to amaze and dazzle your friends at parties after you finally give up that dream of being a magician and stop making ridiculous balloon animals and begin

More information

Careerarm.com. 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle)

Careerarm.com. 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle) 1. What is MySQL? MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle) 2. What are the technical features of MySQL? MySQL database software is a client

More information

Create Basic Databases and Integrate with a Website Lesson 1

Create Basic Databases and Integrate with a Website Lesson 1 Create Basic Databases and Integrate with a Website Lesson 1 Getting Started with Web (SQL) Databases In order to make a web database, you need three things to work in cooperation. You need a web server

More information

Advanced SQL. Nov 21, CS445 Pacific University 1

Advanced SQL. Nov 21, CS445 Pacific University 1 Advanced SQL Nov 21, 2017 http://zeus.cs.pacificu.edu/chadd/cs445f17/advancedsql.tar.gz Pacific University 1 Topics Views Triggers Stored Procedures Control Flow if / case Binary Data Pacific University

More information

Lecture 5. Monday, September 15, 2014

Lecture 5. Monday, September 15, 2014 Lecture 5 Monday, September 15, 2014 The MySQL Command So far, we ve learned some parts of the MySQL command: mysql [database] [-u username] p [-- local-infile]! Now let s go further 1 mysqldump mysqldump

More information

Exact Numeric Data Types

Exact Numeric Data Types SQL Server Notes for FYP SQL data type is an attribute that specifies type of data of any object. Each column, variable and expression has related data type in SQL. You would use these data types while

More information

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Web programming The PHP language Our objective Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Access data inserted by users into HTML forms Interact

More information

COMP519: Web Programming Autumn 2015

COMP519: Web Programming Autumn 2015 COMP519: Web Programming Autumn 2015 In the next lectures you will learn What is SQL How to access mysql database How to create a basic mysql database How to use some basic queries How to use PHP and mysql

More information

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37)

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) A Server-side Scripting Programming Language An Introduction What is PHP? PHP stands for PHP: Hypertext Preprocessor. It is a server-side

More information

Basic SQL. Basic SQL. Basic SQL

Basic SQL. Basic SQL. Basic SQL Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation Basic SQL Structured

More information

SQL. Often times, in order for us to build the most functional website we can, we depend on a database to store information.

SQL. Often times, in order for us to build the most functional website we can, we depend on a database to store information. Often times, in order for us to build the most functional website we can, we depend on a database to store information. If you ve ever used Microsoft Excel or Google Spreadsheets (among others), odds are

More information

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users Introduction to PHP Let's Look Back We talked about how to create a form in HTML Forms are one way to interact with users Users can enter information into forms which can be used by you (programmer) We

More information

Basic SQL. Dr Fawaz Alarfaj. ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation

Basic SQL. Dr Fawaz Alarfaj. ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation Basic SQL Dr Fawaz Alarfaj Al Imam Mohammed Ibn Saud Islamic University ACKNOWLEDGEMENT Slides are adopted from: Elmasri & Navathe, Fundamentals of Database Systems MySQL Documentation MIDTERM EXAM 2 Basic

More information

EE221 Databases Practicals Manual

EE221 Databases Practicals Manual EE221 Databases Practicals Manual Lab 1 An Introduction to SQL Lab 2 Database Creation and Querying using SQL Assignment Data Analysis, Database Design, Implementation and Relation Normalisation School

More information

Data Definition Language with mysql. By Kautsar

Data Definition Language with mysql. By Kautsar Data Definition Language with mysql By Kautsar Outline Review Create/Alter/Drop Database Create/Alter/Drop Table Create/Alter/Drop View Create/Alter/Drop User Kautsar -2 Review Database A container (usually

More information

Oracle SQL Developer. Supplementary Information for MySQL Migrations Release 2.1 E

Oracle SQL Developer. Supplementary Information for MySQL Migrations Release 2.1 E Oracle SQL Developer Supplementary Information for MySQL Migrations Release 2.1 E15225-01 December 2009 This document contains information for migrating from MySQL to Oracle. It supplements the information

More information

SQL Data Definition Language: Create and Change the Database Ray Lockwood

SQL Data Definition Language: Create and Change the Database Ray Lockwood Introductory SQL SQL Data Definition Language: Create and Change the Database Pg 1 SQL Data Definition Language: Create and Change the Database Ray Lockwood Points: DDL statements create and alter the

More information

PHP. Interactive Web Systems

PHP. Interactive Web Systems PHP Interactive Web Systems PHP PHP is an open-source server side scripting language. PHP stands for PHP: Hypertext Preprocessor One of the most popular server side languages Second most popular on GitHub

More information

Simple Quesries in SQL & Table Creation and Data Manipulation

Simple Quesries in SQL & Table Creation and Data Manipulation Simple Quesries in SQL & Table Creation and Data Manipulation Based on CBSE Curriculum Class -11 By- Neha Tyagi PGT CS KV 5 Jaipur II Shift Jaipur Region Neha Tyagi, PGT CS II Shift Jaipur Introduction

More information

Basis Data Terapan. Yoannita

Basis Data Terapan. Yoannita Basis Data Terapan Yoannita SQL Server Data Types Character strings: Data type Description Storage char(n) varchar(n) varchar(max) text Fixed-length character string. Maximum 8,000 characters Variable-length

More information

Database Connectivity using PHP Some Points to Remember:

Database Connectivity using PHP Some Points to Remember: Database Connectivity using PHP Some Points to Remember: 1. PHP has a boolean datatype which can have 2 values: true or false. However, in PHP, the number 0 (zero) is also considered as equivalent to False.

More information

COM1004 Web and Internet Technology

COM1004 Web and Internet Technology COM1004 Web and Internet Technology When a user submits a web form, how do we save the information to a database? How do we retrieve that data later? ID NAME EMAIL MESSAGE TIMESTAMP 1 Mike mike@dcs Hi

More information

Unit 1 - Chapter 4,5

Unit 1 - Chapter 4,5 Unit 1 - Chapter 4,5 CREATE DATABASE DatabaseName; SHOW DATABASES; USE DatabaseName; DROP DATABASE DatabaseName; CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype,... columnn

More information

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language

Information Systems Engineering. SQL Structured Query Language DDL Data Definition (sub)language Information Systems Engineering SQL Structured Query Language DDL Data Definition (sub)language 1 SQL Standard Language for the Definition, Querying and Manipulation of Relational Databases on DBMSs Its

More information

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008.

PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008. PHP: Cookies, Sessions, Databases. CS174. Chris Pollett. Sep 24, 2008. Outline. How cookies work. Cookies in PHP. Sessions. Databases. Cookies. Sometimes it is useful to remember a client when it comes

More information

SQL Data Definition and Data Manipulation Languages (DDL and DML)

SQL Data Definition and Data Manipulation Languages (DDL and DML) .. Cal Poly CPE/CSC 365: Introduction to Database Systems Alexander Dekhtyar.. SQL Data Definition and Data Manipulation Languages (DDL and DML) Note: This handout instroduces both the ANSI SQL synatax

More information

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 11 Introduction to PHP

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 11 Introduction to PHP Chapter 11 Introduction to PHP 11.1 Origin and Uses of PHP Developed by Rasmus Lerdorf in 1994 PHP is a server-side scripting language, embedded in XHTML pages PHP has good support for form processing

More information

Introduction to MySQL /MariaDB and SQL Basics. Read Chapter 3!

Introduction to MySQL /MariaDB and SQL Basics. Read Chapter 3! Introduction to MySQL /MariaDB and SQL Basics Read Chapter 3! http://dev.mysql.com/doc/refman/ https://mariadb.com/kb/en/the-mariadb-library/documentation/ MySQL / MariaDB 1 College Database E-R Diagram

More information

Read this before starting!

Read this before starting! Portion of test Points possible Written: 60 Code Modification: 20 Debug/Coding: 20 Total: 100 Points missed Points correct Student's Name: East Tennessee State University Department of Computer and Information

More information

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client

This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client Lab 2.0 - MySQL CISC3140, Fall 2011 DUE: Oct. 6th (Part 1 only) Part 1 1. Getting started This lab will introduce you to MySQL. Begin by logging into the class web server via SSH Secure Shell Client host

More information

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS 1 INTRODUCTION TO EASIK EASIK is a Java based development tool for database schemas based on EA sketches. EASIK allows graphical modeling of EA sketches and views. Sketches and their views can be converted

More information

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL. Hello everyone! Welcome to our PHP + MySQL (Easy to learn) E.T.L. free online course Hope you have installed your XAMPP? And you have created your forms inside the studio file in the htdocs folder using

More information

UNIT V ESTABLISHING A DATABASE CONNECTION AND WORKING WITH DATABASE

UNIT V ESTABLISHING A DATABASE CONNECTION AND WORKING WITH DATABASE UNIT V 1 ESTABLISHING A DATABASE CONNECTION AND WORKING WITH DATABASE SYLLABUS 5.1 Overview of Database 5.2 Introduction to MYSQL 5.3 Creating Database using phpmyadmin & Console(using query, using Wamp

More information

Server Side Scripting Report

Server Side Scripting Report Server Side Scripting Report David Nelson 205CDE Developing the Modern Web Assignment 2 Student ID: 3622926 Computing BSc 29 th March, 2013 http://creative.coventry.ac.uk/~nelsond/ - Page 1 - Contents

More information

Draft. Students Table. FName LName StudentID College Year. Justin Ennen Science Senior. Dan Bass Management Junior

Draft. Students Table. FName LName StudentID College Year. Justin Ennen Science Senior. Dan Bass Management Junior Chapter 6 Introduction to SQL 6.1 What is a SQL? When would I use it? SQL stands for Structured Query Language. It is a language used mainly for talking to database servers. It s main feature divisions

More information

How to use SQL to create a database

How to use SQL to create a database Chapter 17 How to use SQL to create a database How to create a database CREATE DATABASE my_guitar_shop2; How to create a database only if it does not exist CREATE DATABASE IF NOT EXISTS my_guitar_shop2;

More information

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University CS 377 Database Systems Database Programming in PHP Li Xiong Department of Mathematics and Computer Science Emory University Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP

More information

C Basics And Concepts Input And Output

C Basics And Concepts Input And Output C Basics And Concepts Input And Output Report Working group scientific computing Department of informatics Faculty of mathematics, informatics and natural sciences University of Hamburg Written by: Marcus

More information

Dept. of CSE, IIT KGP

Dept. of CSE, IIT KGP Control Flow: Looping CS10001: Programming & Data Structures Pallab Dasgupta Professor, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Types of Repeated Execution Loop: Group of

More information

sqoop Automatic database import Aaron Kimball Cloudera Inc. June 18, 2009

sqoop Automatic database import Aaron Kimball Cloudera Inc. June 18, 2009 sqoop Automatic database import Aaron Kimball Cloudera Inc. June 18, 2009 The problem Structured data already captured in databases should be used with unstructured data in Hadoop Tedious glue code necessary

More information

Loops! Loops! Loops! Lecture 5 COP 3014 Fall September 25, 2017

Loops! Loops! Loops! Lecture 5 COP 3014 Fall September 25, 2017 Loops! Loops! Loops! Lecture 5 COP 3014 Fall 2017 September 25, 2017 Repetition Statements Repetition statements are called loops, and are used to repeat the same code mulitple times in succession. The

More information

Mount Saint Mary College, Newburgh, NY Internet Programming III - CIT310

Mount Saint Mary College, Newburgh, NY Internet Programming III - CIT310 Warm up mini-lab Lab 1 - Functions Type in the following function definition and calls to the function. Test it and understand it. function myprint($str= No String Supplied ) // the argument is optional

More information

Chapter 9: MySQL for Server-Side Data Storage

Chapter 9: MySQL for Server-Side Data Storage Chapter 9: MySQL for Server-Side Data Storage General Notes on the Slides for This Chapter In many slides you will see webbook as a database name. That was the orginal name of our database. For this second

More information

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-1

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-1 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II Section : CSE - 1 & 2 Subject Code : CS6202 Subject Name : Programming and Data Structures-I Degree & Branch : B.E C.S.E. 2 MARK

More information

Introduction. C provides two styles of flow control:

Introduction. C provides two styles of flow control: Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if

More information

*this is a guide that was created from lecture videos and is used to help you gain an understanding of what is mysql used for.

*this is a guide that was created from lecture videos and is used to help you gain an understanding of what is mysql used for. mysql. 1 what is mysql used for. *this is a guide that was created from lecture videos and is used to help you gain an understanding of what is mysql used for. MySQL Installation MySQL is an open source

More information

PHP Development - Introduction

PHP Development - Introduction PHP Development - Introduction Php Hypertext Processor PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server PHP supports many

More information

Chapter 7 PHP Files & MySQL Databases

Chapter 7 PHP Files & MySQL Databases Chapter 7 PHP Files & MySQL Databases At the end of the previous chapter, a simple calendar was displayed with an appointment. This demonstrated again how forms can be used to pass data from one page to

More information

Acknowledgments About the Authors

Acknowledgments About the Authors Acknowledgments p. xi About the Authors p. xiii Introduction p. xv An Overview of MySQL p. 1 Why Use an RDBMS? p. 2 Multiuser Access p. 2 Storage Transparency p. 2 Transactions p. 3 Searching, Modifying,

More information

PHP Introduction. Some info on MySQL which we will cover in the next workshop...

PHP Introduction. Some info on MySQL which we will cover in the next workshop... PHP and MYSQL PHP Introduction PHP is a recursive acronym for PHP: Hypertext Preprocessor -- It is a widely-used open source general-purpose serverside scripting language that is especially suited for

More information

Web System Development with Ruby on Rails

Web System Development with Ruby on Rails Web System Development with Ruby on Rails Day 6(25/Oct/2011) Database Language: SQL Today's Theme Learn What is Database p Learn database language: SQL p Add one table to the project Is this too easy,

More information

COMP284 Scripting Languages Lecture 11: PHP (Part 3) Handouts

COMP284 Scripting Languages Lecture 11: PHP (Part 3) Handouts COMP284 Scripting Languages Lecture 11: PHP (Part 3) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

Introduction to Databases and SQL

Introduction to Databases and SQL Introduction to Databases and SQL Files vs Databases In the last chapter you learned how your PHP scripts can use external files to store and retrieve data. Although files do a great job in many circumstances,

More information

n Group of statements that are executed repeatedly while some condition remains true

n Group of statements that are executed repeatedly while some condition remains true Looping 1 Loops n Group of statements that are executed repeatedly while some condition remains true n Each execution of the group of statements is called an iteration of the loop 2 Example counter 1,

More information

The Top 20 Design Tips

The Top 20 Design Tips The Top 20 Design Tips For MySQL Enterprise Data Architects Ronald Bradford COO PrimeBase Technologies April 2008 Presented Version By: 1.1 Ronald 10.Apr.2008 Bradford 1. Know Your Technology Tools Generics

More information

Read this before starting!

Read this before starting! Portion of test Points possible Written: 60 Code Modification: 20 Debug/Coding: 20 Total: 100 Points missed Points correct Student's Name: East Tennessee State University Department of Computer and Information

More information

Department of Computer Science University of Cyprus. EPL342 Databases. Lab 1. Introduction to SQL Server Panayiotis Andreou

Department of Computer Science University of Cyprus. EPL342 Databases. Lab 1. Introduction to SQL Server Panayiotis Andreou Department of Computer Science University of Cyprus EPL342 Databases Lab 1 Introduction to SQL Server 2008 Panayiotis Andreou http://www.cs.ucy.ac.cy/courses/epl342 1-1 Before We Begin Start the SQL Server

More information

Midterm Exam 2 Solutions C Programming Dr. Beeson, Spring 2009

Midterm Exam 2 Solutions C Programming Dr. Beeson, Spring 2009 Midterm Exam 2 Solutions C Programming Dr. Beeson, Spring 2009 April 16, 2009 Instructions: Please write your answers on the printed exam. Do not turn in any extra pages. No interactive electronic devices

More information

Web Programming. Dr Walid M. Aly. Lecture 10 PHP. lec10. Web Programming CS433/CS614 22:32. Dr Walid M. Aly

Web Programming. Dr Walid M. Aly. Lecture 10 PHP. lec10. Web Programming CS433/CS614 22:32. Dr Walid M. Aly Web Programming Lecture 10 PHP 1 Purpose of Server-Side Scripting database access Web page can serve as front-end to a database Ømake requests from browser, Øpassed on to Web server, Øcalls a program to

More information

Web Database Programming

Web Database Programming Web Database Programming Web Database Programming 2011 Created: 2011-01-21 Last update: 2014-01-14 Contents Introduction... 2 Use EasyDataSet as Data Source... 2 Add EasyDataSet to web page... 3 Make Database

More information

Continued from previous lecture

Continued from previous lecture The Design of C: A Rational Reconstruction: Part 2 Jennifer Rexford Continued from previous lecture 2 Agenda Data Types Statements What kinds of operators should C have? Should handle typical operations

More information

cis20.2-spring2010-sklar-lecii.4 1

cis20.2-spring2010-sklar-lecii.4 1 cis20.2 design and implementation of software applications 2 spring 2010 lecture # II.4 today s topics: introduction to php on-line documentation http://www.php.net (php home page) http://www.php.net/manual/en/

More information

Files and Streams Opening and Closing a File Reading/Writing Text Reading/Writing Raw Data Random Access Files. C File Processing CS 2060

Files and Streams Opening and Closing a File Reading/Writing Text Reading/Writing Raw Data Random Access Files. C File Processing CS 2060 CS 2060 Files and Streams Files are used for long-term storage of data (on a hard drive rather than in memory). Files and Streams Files are used for long-term storage of data (on a hard drive rather than

More information

Pointers cause EVERYBODY problems at some time or another. char x[10] or char y[8][10] or char z[9][9][9] etc.

Pointers cause EVERYBODY problems at some time or another. char x[10] or char y[8][10] or char z[9][9][9] etc. Compound Statements So far, we ve mentioned statements or expressions, often we want to perform several in an selection or repetition. In those cases we group statements with braces: i.e. statement; statement;

More information

What is PHP? [1] Figure 1 [1]

What is PHP? [1] Figure 1 [1] PHP What is PHP? [1] PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use Figure

More information

Networks and Web for Health Informatics (HINF 6220) Tutorial 13 : PHP 29 Oct 2015

Networks and Web for Health Informatics (HINF 6220) Tutorial 13 : PHP 29 Oct 2015 Networks and Web for Health Informatics (HINF 6220) Tutorial 13 : PHP 29 Oct 2015 PHP Arrays o Arrays are single variables that store multiple values at the same time! o Consider having a list of values

More information

General References on SQL (structured query language) SQL tutorial.

General References on SQL (structured query language) SQL tutorial. Week 8 Relational Databases Reading DBI - Database programming with Perl Appendix A and B, Ch 1-5 General References on SQL (structured query language) SQL tutorial http://www.w3schools.com/sql/default.asp

More information

Programming and Database Fundamentals for Data Scientists

Programming and Database Fundamentals for Data Scientists Programming and Database Fundamentals for Data Scientists Database Fundamentals Varun Chandola School of Engineering and Applied Sciences State University of New York at Buffalo Buffalo, NY, USA chandola@buffalo.edu

More information

Oracle Login Max Length Table Name 11g Column Varchar2

Oracle Login Max Length Table Name 11g Column Varchar2 Oracle Login Max Length Table Name 11g Column Varchar2 Get max(length(column)) for all columns in an Oracle table tables you are looking at BEGIN -- loop through column names in all_tab_columns for a given

More information

More loops. Control structures / flow control. while loops. Loops / Iteration / doing things over and over and over and over...

More loops. Control structures / flow control. while loops. Loops / Iteration / doing things over and over and over and over... Control structures / flow control More loops while loops if... else Switch for loops while... do.. do... while... Much of this material is explained in PHP programming 2nd Ed. Chap 2 Control structures

More information

PHPoC vs PHP > Overview. Overview

PHPoC vs PHP > Overview. Overview PHPoC vs PHP > Overview Overview PHPoC is a programming language that Sollae Systems has developed. All of our PHPoC products have PHPoC interpreter in firmware. PHPoC is based on a wide use script language

More information

PHP Reference. To access MySQL manually, run the following command on the machine, called Sources, where MySQL and PhP have been installed:

PHP Reference. To access MySQL manually, run the following command on the machine, called Sources, where MySQL and PhP have been installed: PHP Reference 1 Preface This tutorial is designed to teach you all the PHP commands and constructs you need to complete your PHP project assignment. It is assumed that you have never programmed in PHP

More information

Networks and Web for Health Informatics (HINF 6220)

Networks and Web for Health Informatics (HINF 6220) Networks and Web for Health Informatics (HINF 6220) Tutorial #1 Raheleh Makki Email: niri@cs.dal.ca Tutorial Class Timings Tuesday & Thursday 4:05 5:25 PM Course Outline Database Web Programming SQL PHP

More information

Database Systems. phpmyadmin Tutorial

Database Systems. phpmyadmin Tutorial phpmyadmin Tutorial Please begin by logging into your Student Webspace. You will access the Student Webspace by logging into the Campus Common site. Go to the bottom of the page and click on the Go button

More information

Tool/Web URL Features phpmyadmin. More on phpmyadmin under User Intefaces. MySQL Query Browser

Tool/Web URL Features phpmyadmin.   More on phpmyadmin under User Intefaces. MySQL Query Browser To store data in MySQL, we will set up a database and then place tables, relationships and other objects in that database, following a design that maps to our application requirements. We will use a command-line

More information

Full file at

Full file at ch2 True/False Indicate whether the statement is true or false. 1. The SQL command to create a database table is an example of DML. 2. A user schema contains all database objects created by a user. 3.

More information

Database and MySQL Temasek Polytechnic

Database and MySQL Temasek Polytechnic PHP5 Database and MySQL Temasek Polytechnic Database Lightning Fast Intro Database Management Organizing information using computer as the primary storage device Database The place where data are stored

More information

CSC 3300 Homework 3 Security & Languages

CSC 3300 Homework 3 Security & Languages CSC 3300 Homework 3 Security & Languages Description Homework 3 has two parts. Part 1 is an exercise in database security. In particular, Part 1 has practice problems in which your will add constraints

More information

PHPoC. PHPoC vs PHP. Version 1.1. Sollae Systems Co., Ttd. PHPoC Forum: Homepage:

PHPoC. PHPoC vs PHP. Version 1.1. Sollae Systems Co., Ttd. PHPoC Forum:  Homepage: PHPoC PHPoC vs PHP Version 1.1 Sollae Systems Co., Ttd. PHPoC Forum: http://www.phpoc.com Homepage: http://www.eztcp.com Contents 1 Overview...- 3 - Overview...- 3-2 Features of PHPoC (Differences from

More information

Advanced Web Programming Practice Exam II

Advanced Web Programming Practice Exam II Advanced Web Programming Practice Exam II Name: 12 December 2017 This is a closed book exam. You may use one sheet of notes (8.5X11in, front only) but cannot use any other references or electronic device.

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 2 : C# Language Basics Lecture Contents 2 The C# language First program Variables and constants Input/output Expressions and casting

More information

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access

HKTA TANG HIN MEMORIAL SECONDARY SCHOOL SECONDARY 3 COMPUTER LITERACY. Name: ( ) Class: Date: Databases and Microsoft Access Databases and Microsoft Access Introduction to Databases A well-designed database enables huge data storage and efficient data retrieval. Term Database Table Record Field Primary key Index Meaning A organized

More information

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Object oriented programming. Instructor: Masoud Asghari Web page:   Ch: 3 Object oriented programming Instructor: Masoud Asghari Web page: http://www.masses.ir/lectures/oops2017sut Ch: 3 1 In this slide We follow: https://docs.oracle.com/javase/tutorial/index.html Trail: Learning

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

CSC Web Programming. Introduction to SQL

CSC Web Programming. Introduction to SQL CSC 242 - Web Programming Introduction to SQL SQL Statements Data Definition Language CREATE ALTER DROP Data Manipulation Language INSERT UPDATE DELETE Data Query Language SELECT SQL statements end with

More information