일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- data distribution
- polynomial regression
- self parameter
- error
- matplotlib.pyplot
- line color
- break
- AS
- continue
- Default X points
- machine learning
- Python
- PANDAS
- pie charts
- multiple lines
- SQL
- PROJECT
- start exercise
- Text Analytics
- Else
- Text mining
- MySQL
- matplotlib
- line width
- iterates
- Github
- variables
- For loops
- train/test
- __init__
- Today
- Total
목록MySQL (20)
Data Science Explorer

The IN operator allows you to specify multiple values in a WHERE clause. It is a shortcut for multiple OR conditions. Syntax SELECT column_name(s) FROM table_name WHERE column_name IN (value1, value2, ...); Example Return all the students from 'South Korea' and 'North Korea' SELECT * FROM Students WHERE Country IN ('South Korea', 'North Korea'); NOT IN When you use NOT IN operator, you return al..

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. There are two different wildcards often used in conjunction with the LIKE operator: The percent sign % represents zero, one, or multiple characters The underscore sign _ represents one, single charater Syntax SELECT column1, column2, ... FROM table_name WHERE columnN LIKE pattern; The_Wildcard The _ wildca..

The AVG() function returns the average value of a numeric column. Syntax SELECT AVG(column_name) FROM table_name WHERE condition; Example Find the average price of all cups. SELECT AVG(Price) FROM Cups; ** NULL is ignored** Add a WHERE Clause You can specify conditions by using WHERE clause. Example Return the average price of sweaters in category 90: SELECT AVG(Price) FROM Sweaters WHERE Custom..

The SUM () function gives you the totla sum of a numeric column. Syntax SELECT SUM(column_name) FROM table_name WHERE condition; Example Write an SQL query to return the sum of all the "TotalAmount" fields in the "Invoices" table. SELECT SUM(TotalAmount) AS "Total Sum" FROM Invoices; Add a WHERE Clause This is to specify conditions: Example Return the number of orders made for the product with C..

The COUNT () function gives the number of rows that matches a specified criterion. Example Find the total number of brands in the Brands table: SELECT COUNT(*) FROM Brands; Syntax SELECT COUNT(column_name) FROM table_name WHERE condition; Add a WHERE cluase Example Find the number of food where Price is higher than $11: SELECT COUNT (*) FROM FOODS WHERE Price > 11; Specify Column Instead of usin..

The MIN() function gives you the smallest value of the selected column and MAX() gives you the biggest value. Syntax MIN () SELECT MIN(column_name) FROM table_name WHERE condition; MAX() SELECT MAX(column_name) FROM table_name WHERE condition; MIN () Example Find the lowest grade: SELECT MIN(Grade) FROM Students; MAX() Example Find the highest grade: SELECT MAX(Grade) FROM Students; Set Colum Na..

The DELETE statement is used to remove existing records in a table. DELETE Syntax DELETE FROM table_name WHERE condition; ** WARNING: Be careful when you delete records in a table! If you omit the WHERE clause, all records in the table will be deleted. The Where clause in the DELETE statement. ** Example Delete the customer "Jack Lee" from the "Customers" table: DELETE FROM Customers WHERE Custo..

The UPDATE statement is used to modify the existing records in a table. UPDATE Syntax UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition; ** Tip: Notice the WHERE clause in the UPDATE statement.** UPDATE Table Example Update the first customer (CustomerID = 60) with a new contact person and a new city. UPDATE Customers SET ContactName = 'Pearl', City = 'Seoul' WHERE Cu..

NULL value is a field of no value. Test for NULL Values IS NULL Syntax SELECT column_names FROM table_name WHERE column_name IS NULL; IS NOT NULL Syntax SELECT column_names FROM table_name WHERE column_name IS NOT NULL; IS NULL Operator The NULL operator is used to test for empty values which is NULL Values. Example Write SQL lists all guests with a NULL values in the "City" field: SELECT Countr..

The INSERT INTO statement is used to insert new records in a table. Syntax There are two different ways to write INSERT INTO statement: 1) Specify both the column names and the values to be inserted: INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...); 2) When you do not need to specify the column names in the SQL query: INSERT INTO table_name VALUES (val..