-
w3schools - sql exercise (1)공부/PS ( SQL) 2021. 11. 30. 01:04
SELECT * FROM Customers WHERE NOT CITY = 'Berlin'
SELECT * FROM Customers ORDER BY Country, City
참고)
SELECT * FROM table_name ORDER BY column1, column2 DESC
column1 기준 오름차순 정렬 후 column2 기준 내림차순 정렬
INSERT Customers ( CustomerName, Address, City, PostalCode, Country ) VALUES ( 'Hekkan Burger', 'Gateveien 15', 'Sandnes', '4306', 'Norway' ) ;
UPDATE Customers SET City = 'Oslo';
DELETE FROM Customers WHERE Country = 'Norway';
SELECT * FROM Customers WHERE City LIKE 'a%'
SELECT * FROM Customers WHERE City NOT LIKE 'a%'
SELECT * FROM Customers WHERE City LIKE '[acs]%';
SELECT * FROM Customers WHERE City LIKE '[a-f]%';
SELECT * FROM Customers WHERE City LIKE '[!acf]%';
SELECT * FROM Customers WHERE Country IN ('Norway', 'France');
SELECT * FROM Products WHERE Price BETWEEN 10 AND 20;
'공부 > PS ( SQL)' 카테고리의 다른 글
[HackerRank/Basic Select] Weather Observation Station 5 (0) 2022.05.15 [HackerRank/Basic Select] Weather Observation Station 4 (0) 2022.05.15 [HackerRank/Basic Select] Weather Observation Station 3 (0) 2021.09.24 [HackerRank/Basic Select] Weather Observation Station 1 (0) 2021.09.24 [HackerRank/Basic Select] Japanese Cities' Names (0) 2021.09.24