代写sql | 代做php | database作业 – Phase 2

Phase 2

代写sql | 代做php | database作业 – 这是利用php进行训练的代写, 对php的流程进行训练解析, 包括了sql/php/database等方面

sql代写 代写sql 数据库代写

Please use this template as a guide for what to submit for phase 2. Include team number, class, and current term in the
header for all pages (show above). Also include a table of contents (TOC) as the first page of your
team00 1 _p2_ac+ sql .pdf with working links to navigate the task document quickly. Use consistent indentation, font
sizes, and bullets to model control flow. Lastly, include consistent markup to convey meaning (bold, italic, underline,
etc.) with an example shown below:
Table of Contents:
Abstract Code+SQL for each task on a single page with working navigation links.
Abstract Code:
Your abstract code should handle basic data validation (example: user cannot enter string for an int datatype) and basic
error handling (example: user types in wrong password what happens?). Consider the IFD forms to be like web-page
user interfaces where the user clicks on buttons or types input fields. Walk us through how you get to each task and how
you leave each task to get to the next one.
Include consistent markup to convey meaning (bold, italic, underline, etc.) Include the words  task, form, and button
(or similar) after every use in your abstract code so there is no confusion on intent.
Note: application variables like '$Email' are optional depending on your language- PHP, Python, Java, Ruby. Include
inline code blocks for all SQL queries with semicolon.
Markup something similar to:
Bold Underline: Form Example: Main Menu form
Bold Italics: Buttons Example: Save button
Bold: Task Example: Login task
Italics: Form Input Fields: Example: username, model, cost, etc.
DB Query Code Blocks: specific targeted queries which include semicolon delimiter ; U+003B
Watch the use of the bad: left/right single quotes vs. the good: U+ 27 single apostrophe ‘
Inline queries should be UNICODE text NOT IMAGES:
SELECT first_name, last_name, home_town FROM `User` INNER JOIN RegularUser on
RegularUser.email = User.email WHERE RegularUser.email = '$UserID';

DARK Blue: database table names in lowercase DARK Green: php Application Variables $param (in single UNICODE 27 quotes) Good: Grave Accent (backtick) ` = U+60 (escape character) Apostrophe ‘ = U+27 (good for param) Bad: Left Single Quote = U+2018 or Right Single Quote = U+2019 (queries will fail) https://unicode-table.com/en/search/?q=% http://stackoverflow.com/questions/7857278/what-is-the-meaning-of-grave-accent-aka-backtick-quoted-characters-in-mysql

Your Queries should be specific to the result set you want to obtain from the database:
$goodQuery = SELECT password FROM user WHERE email='$enteredEmail';
$badQuery = SELECT * FROM user WHERE email='$enteredEmail';
Notice how the SELECT * requires the application logic to sort out the returned values and not the query.
The point of the course is to develop SQL query skills to extract exactly what you want from the database.

Grading considerations: inline queries should be able to be copy/pasted into SQL command line and run successfully based on your imported team##_p2_schema.sql. Note: Phase2 team001_p2_ac+SQL.pdf does not contain any task decomposition components: no oval diagrams, no rules of thumb, just the abstract code with the additional SQL code blocks.

Feel free to post a private question: (Team## + Instructors) if you need further clarification for your project. Thank you
in advance,
CS6400 Instructional Team
Table of Contents:
Login
Main Menu
View Profile

…etc.

Login

Abstract Code
 User enters email ($Email), password ($Password) input fields.
 If data validation is successful for both email and password input fields, then:
 When Enter button is clicked:
SELECT password FROM `User` WHERE email= '$Email';
 If User record is found but User.password != '$Password':
 Go back to Login form, with error message.
 Else:
 Store login information as session variable '$UserID'.
 Go to Main Menu form.
 Else email and password input fields are invalid, display Login form, with error message.

Main Menu / Navigation Bar

Abstract Code
 Show "View Profile", "Edit Profile, View Friends " , Search for Friends " , View Requests " ,
View Status Updates ", and "Log out" tabs in navigation bar.
 Upon:
 Click View Profile button- Jump to the View Profile task.
 Click Edit Profile button- Jump to the Edit Profile task.
 Click View Friends button- Jump to the View Friends task.
 Click Search for Friends button- Jump to the Search for Friends task.
 Click View Requests button- Jump to the View Requests task.
 Click View Status Updates button- Jump to the View Status Updates task.
 Click Log Out button- Invalidate login session and go back to the Login form.

View Profile

Abstract Code
 User clicked on View Profile button from Main Menu:
 Run the View Profile task: query for information about the user and their profile where $UserID is the
ID of the current user using the system from the HTTP Session/Cookie.
 Find the current User using the User.email; Display users first and last name;
 Find the current RegularUser using the user Email; Display RegularUser Sex, Birthdate, CurrentCity,
Hometown, and Interests.
 Find and display the current user interests:
SELECT first_name, last_name FROM `User` WHERE User.email='$UserID';
SELECT first_name, last_name, gender, birthdate, current_city, home_town FROM `User`
INNER JOIN RegularUser ON `User`.email=RegularUser.email WHERE
`User`.email='$UserID';
SELECT interest FROM UserInterests WHERE email='$UserID';
 Find each School for the RegularUser:
Display School name and Years Graduated;
Find School Type;
Display SchoolType Name;

For each Employer for the RegularUser: Display Employer Name and Job Titles;

When ready, user selects next action from choices in Main Menu
...etc.
SELECT school_name, year_graduated FROM Attend WHERE email='$UserID' ORDER BY
year_graduated DESC;
SELECT employer_name, job_title FROM Employment WHERE email='$UserID' ORDER BY
employer_name DESC;