SQL Code for Byrnetube video

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Slide 1 Chapter 01 Managing Student Type Information.
NMED 3850 A Advanced Online Design February 25, 2010 V. Mahadevan.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
SQL Keys and Constraints Justin Maksim. Key Declaration Key constraint defined within the CREATE TABLE command Key can be declared using either the PRIMARY.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
DBMS 3. course. Reminder Data independence: logical and physical Concurrent processing – Transaction – Deadlock – Rollback – Logging ER Diagrams.
MySql In Action Step by step method to create your own database.
PHP1-1 PHP & SQL Xingquan (Hill) Zhu
5.3. Querying a Database SQL -> DDL, DML. SQL Structured Query Language – industry standard supported by all significant relational databases. First SQL.
Databases in Visual Studio. Database in VisualStudio An MS SQL database are built in Visual studio The Name can be something like ”(localdb)\Projects”
© 2011 PLANET TECHNOLOGIES, INC. Using SPD and SQL Stored Procedures Patrick Curran, MCT AUGUST 12, 2011.
Stored Procedures, Triggers, Program Access Dr Lisa Ball 2008.
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.
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.
Advanced Database Management System
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
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.
Web Programming Language Week 7 Dr. Ken Cosh PHP and storage.
SQL Structured Query Language 1. Data Definition Language (DDL) is used to manage table and define data structure i.e. CREATE, ALTER, DROP Data Control.
What’s a database? Data stored in a structured format that lends itself to easy manipulation and recall.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) Relational Schema and SQL Queries James Wang.
Creating A Database Driven Website 1.Setting Up Your Web Server 2.Creating a Database 3.Creating a Webpage to Display Information From a Database 4.Creating.
CHAPTER 10 PHP MySQL Database
There are two types of MySQL instructions (Data Definition Language) DDL: Create database, create table, alter table,,,. (Data Manipulation Language) DML.
Introduction to MySQL Ullman Chapter 4. Introduction MySQL most popular open-source database application Is commonly used with PHP We will learn basics.
SQL constrains and keys. SORTED RESULTS Sort the results by a specified criterion SELECT columns FROM tables WHERE predicates ORDER BY column ASC/DESC;
Databases and SQL CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Introduction to Databases & SQL Ahmet Sacan. What you’ll need Firefox, SQLite plugin Mirdb and Targetscan databases.
SQL CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
How To Start a SQL server Connecting to SQL Server.
 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.
IS232 Lab 9. CREATE USER Purpose: Use the CREATE USER statement to create and configure a database user, which is an account through which you can log.
DBMS Programs MS SQL Server & MySQL
PostgreSQL S511.
Databases.
COP 4540 Database Management
© 2016, Mike Murach & Associates, Inc.
Instructor: Jason Carter
Database Keys and Constraints
Unix System Administration
Storing Images Connect to the server using the correct username and password. $conn = mysql_connect(“yourserver”, “joeuser”, “yourpass”); Create the database.
Referential Integrity MySQL
CS311 Database Management system
Error Handling Summary of the next few pages: Error Handling Cursors.
Structured Query Language (Data definition Language)
Lecturer: Mukhtar Mohamed Ali “Hakaale”
PHPMyAdmin.
For student, require values for name and address.
The PROCESS of Queries John Deardurff
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
مقدمة في قواعد البيانات
PostgreSQL S511.
Rob Gleasure robgleasure.com
Data Management Innovations 2017 High level overview of DB
Christopher Thielen, Lead Application Developer, DSS IT
The PROCESS of Queries John Deardurff
SQL pepper.
OurSQL = MySQL + Blockchain
Data Definition Language
Dynamic SQL Example declare l_depnam varchar2(20) := 'testing'; l_loc varchar2(10) := 'Dubai'; begin execute immediate 'insert into dept values (:1,:2,:3)'
Instructor: Samia arshad
Assignment: SQL #2 Putting Information into a Database
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
SQL NOT NULL Constraint
SQL (Structured Query Language)
SQL AUTO INCREMENT Field
Presentation transcript:

SQL Code for Byrnetube video Stored Procedures SQL Code for Byrnetube video

SQL for people table CREATE TABLE people ( pid INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(pid), first VARCHAR(15) NOT NULL, last VARCHAR(20) NOT NULL, email VARCHAR(40) NOT NULL, ) ENGINE=INNODB;

SQL for password table CREATE TABLE passwords ( people_id INT NOT NULL, password VARCHAR(10), FOREIGN KEY people_id REFERENCES people (pid) ) ENGINE=INNODB;

SQL to add 2 people to person table INSERT INTO people (first, last, email) VALUES (‘Nicole’,’Polizzi’,’snooki@jerseyshore.com’) VALUES (‘Mike’,’Sorentino’,’situation@jerseyshore.com’) SELECT * FROM people

SQL to add passwords for people INSERT INTO passwords VALUES (‘1’,’gtl’) VALUES (‘2’,’abs’) SELECT * from passwords

SQL to print the database content SELECT * FROM people,passwords WHERE people.pid = password.people_id SELECT first, last, email, password

Query database for first and password SELECT first, password FROM people,passwords WHERE people.pid = password.people_id AND people.email=‘snooki@jerseyshore.com’

Stored Procedure – get first and password CREATE PROCEDURE getFirstPasswordUsingEmail ( IN inputEmail VARCHAR(40) ) BEGIN SELECT first, password FROM people,passwords WHERE people.pid = password.people_id AND people.email=inputEmail END CALL getFirstPasswordUsingEmail(‘situation@jerseyShore.com’)

Stored Procedure – create account CREATE PROCEDURE createAccount ( IN inputFirst VARCHAR(40) IN inputLast VARCHAR(40) IN inputEmail VARCHAR(40) IN inputPassword VARCHAR(40) ) BEGIN DECLARE generatedPid INT INSERT INTO people (first, last, email) VALUES (inputFirst, inputLast, inputEmail) SELECT pid INTO generatedPid FROM people where email=inputEmail INSERT INTO password (people_id, password) VALUES (generatedPid, inputPassword) END