Что такое findslide.org?

FindSlide.org - это сайт презентаций, докладов, шаблонов в формате PowerPoint.


Для правообладателей

Обратная связь

Email: Нажмите что бы посмотреть 

Яндекс.Метрика

Презентация на тему Recall the concept

Learning Objective: Create, evaluate and improve search queries that use multiple criteria and relational operators to find specific information Queries
Recall the conceptDatabaseDatabase ModelDBMS – Benefits of a DBMSXAMPP Entity relationship RDBMS – MySQL Learning Objective: Create, evaluate and improve search queries that use multiple Success criteriaknow what is Queriesknow the purpose of the Queriescan create Queries MySQL – RDBMSSQL stands for the Structured Query Language.It defines how to Создание базы данныхCREATE DATABASE my_first_db;DROP DATABASE: Удалить базу данныхDROP TABLE: Удалить таблицуEXPLAIN: ALTER TABLE: Изменить таблицуУдаляем столбецALTER TABLE users DROP email; Изменение столбцаALTER TABLE usersCHANCE SelectSELECT is used to retrieve rows selected from one or more tables.The SELECT SELECT, WHEREWe need to use another statement, the WHERE clause, allowing us Operators in The WHERE ClauseSo you can see we used AND statement, ExampleSay the police knew that a crime had been committed by a ExampleHowever, the police want to quickly sort through and see who is Select with Comparison OperatorsFor numbers (INT, DECIMAL, FLOAT) For strings, you could also use '=', '', '>', '=',  ' String Pattern Matching - LIKE and NOT LIKE we can perform pattern matching using operator Arithmetic Operators - +, -, *, /, DIV, % Logical Operators - AND, OR, NOT, XOR Further Reading…..IN, NOT INBETWEEN, NOT BETWEENIS NULL, IS NOT NULLORDER BY ClauseSELECT * FROM products WHERE create table Employee(empno int(5) primary key, ename varchar(30), job varchar(25), hiredate date, http://jtest.ru/bazyi-dannyix/sql-dlya-nachinayushhix-chast-3.htmlhttps://www.ntu.edu.sg/home/ehchua/programming/sql/MySQL_Beginner.html https://myrusakov.ru/http://www.firststeps.ru/sql/r.php?9
Слайды презентации

Слайд 2 Learning Objective: Create, evaluate and improve search queries that

Learning Objective: Create, evaluate and improve search queries that use

use multiple criteria and relational operators to find specific

information

Queries


Слайд 3 Success criteria
know what is Queries
know the purpose of

Success criteriaknow what is Queriesknow the purpose of the Queriescan create

the Queries
can create Queries using the structure
can create Queries

using commands SQL: SELECT, WHERE

Слайд 4 MySQL – RDBMS
SQL stands for the Structured Query

MySQL – RDBMSSQL stands for the Structured Query Language.It defines how

Language.
It defines how to insert, retrieve, modify and delete

data.

Слайд 5 Создание базы данных
CREATE DATABASE my_first_db;
DROP DATABASE: Удалить базу

Создание базы данныхCREATE DATABASE my_first_db;DROP DATABASE: Удалить базу данныхDROP TABLE: Удалить

данных
DROP TABLE: Удалить таблицу
EXPLAIN: Показать структуру таблицы
USE: Выбор базы

данных
Создать таблицу
CREATE TABLE users (
    username VARCHAR(20),
    create_date DATE
);
 Первичный ключ
CREATE TABLE users (
    user_id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(20),
    create_date DATE
);



Слайд 6 ALTER TABLE: Изменить таблицу
Удаляем столбец
ALTER TABLE users DROP

ALTER TABLE: Изменить таблицуУдаляем столбецALTER TABLE users DROP email; Изменение столбцаALTER TABLE

email;
 
Изменение столбца
ALTER TABLE users
CHANCE username
User_name VARCHAR;
 
INSERT: Добавляем данные в

таблицу
INSERT INTO users VALUES (”Alex”,’2002-07-25’);
 


Слайд 7 Select
SELECT is used to retrieve rows selected from one

SelectSELECT is used to retrieve rows selected from one or more tables.The

or more tables.
The SELECT statement allows you to ask

the database a question (Query it), and specify what data it returns.

Слайд 8 SELECT, WHERE
We need to use another statement, the

SELECT, WHEREWe need to use another statement, the WHERE clause, allowing

WHERE clause, allowing us to give the query some

criteria (or options):

Слайд 9 Operators in The WHERE Clause
So you can see

Operators in The WHERE ClauseSo you can see we used AND

we used AND statement, we also can use OR,

NOT and others like:


Слайд 10 Example
Say the police knew that a crime had

ExampleSay the police knew that a crime had been committed by

been committed by a heavily scarred woman (4+ scars),

they want a list of all the scarred women:





This would return:

Слайд 11 Example
However, the police want to quickly sort through

ExampleHowever, the police want to quickly sort through and see who

and see who is the most heavily scarred. We

are going to use an ORDER command:




ORDER BY numScars sorts your returned data into DESCending (big to small) or ASCending (small to big) order

Слайд 12 Select with Comparison Operators
For numbers (INT, DECIMAL, FLOAT)

Select with Comparison OperatorsFor numbers (INT, DECIMAL, FLOAT)

Слайд 13 For strings, you could also use '=', '', '>', '=',  '

For strings, you could also use '=', '', '>', '=',  '

strings (e.g., productCode = 'PEC').


Слайд 14 String Pattern Matching - LIKE and NOT LIKE
we can perform pattern

String Pattern Matching - LIKE and NOT LIKE we can perform pattern matching using

matching using operator LIKE (or NOT LIKE) with wildcard

characters. The wildcard '_' matches any single character; '%' matches any number of characters (including zero). For example,

Слайд 15 Arithmetic Operators - +, -, *, /, DIV,

Arithmetic Operators - +, -, *, /, DIV, % Logical Operators - AND, OR, NOT, XOR

%
Logical Operators - AND, OR, NOT, XOR


Слайд 16 Further Reading…..
IN, NOT IN
BETWEEN, NOT BETWEEN
IS NULL, IS NOT NULL
ORDER BY Clause
SELECT

Further Reading…..IN, NOT INBETWEEN, NOT BETWEENIS NULL, IS NOT NULLORDER BY ClauseSELECT * FROM products

* FROM products WHERE name IN ('Pen Red', 'Pen

Black');

SELECT * FROM products WHERE (price BETWEEN 1.0 AND 2.0) AND (quantity BETWEEN 1000 AND 2000);

SELECT * FROM products WHERE productCode IS NULL;

SELECT * FROM products WHERE name LIKE 'Pen %' ORDER BY price DESC;


Слайд 17 create table Employee(empno int(5) primary key, ename varchar(30),

create table Employee(empno int(5) primary key, ename varchar(30), job varchar(25), hiredate

job varchar(25), hiredate date, sal double(10,2), commission double(6,2), deptt

int(2));

INSERT INTO employee VALUES (1001,”Alex”,”Teacher”,’2017-07-25’, 5678.90, 100.0, 10);

Select * from Employee where commission>0

Select jobs from employee;

SELECT * FROM EMPLOYEE WHERE ENAME LIKE “_ _ _ _ _”;

SELECT * FROM EMPLOYEE WHERE ENAME LIKE “_ _ _ _p%”;

SELECT * FROM employee WHERE deptt= 'computer ' ORDER BY ename;

Select ename, hiredate from employee where job not like “history”;





  • Имя файла: recall-the-concept.pptx
  • Количество просмотров: 86
  • Количество скачиваний: 0