
SQL-w3resource练习
文章平均质量分 84
snistty
数据分析养成记
展开
-
SQL-retrieve data from tables
Retrieve data from tablesWrite a SQL statement to display all the information of all salesmen.SELECT * FROM salesman;Write a SQL statement to display a string “This is SQL Exercise, Practice and S...原创 2018-12-06 14:57:50 · 7822 阅读 · 0 评论 -
SQL-Boolean and Relational Operators
Write a query to display all customers with a grade above 100.SELECT * FROM customer WHERE grade>100;Write a query statement to display all customers in New York who have a grade value above 100...原创 2018-12-06 16:08:29 · 290 阅读 · 0 评论 -
SQL-Wildcard and Special operators
下划线_: 通配符/占位符,匹配单个字符ESCAPE:需要查询特殊字符时,使用ESCAPE进行转义语法:WHERE ColumnA LIKE ‘%5/%%’ ESCAPE ‘/’Write a SQL statement to find those salesmen with all information who come from the city either...原创 2018-12-06 17:07:12 · 409 阅读 · 0 评论 -
SQL-Aggregate Functions
Write a SQL statement to find the total purchase amount of all orders.SELECT SUM(purch_amt)FROM orders;Write a SQL statement to find the average purchase amount of all orders.SELECT AVG(purch_amt...原创 2018-12-06 21:08:30 · 650 阅读 · 0 评论 -
SQL-Formatting Output
Write a SQL statement to display the commission with the percent sign ( % ) with salesman ID, name and city columns for all the salesmen.疑问:题目的意思应该是,输出数据时将commission的值转化为百分比值网站给出的标准答案并没有实现此功能---...原创 2018-12-06 23:55:24 · 460 阅读 · 0 评论 -
SQL-Query on Multiple Tables
Write a query to find those customers with their name and those salesmen with their name and city who lives in the same city.SELECT customer.cust_name, salesman.name, customer.cityFROM customerJOIN...原创 2018-12-07 00:55:46 · 356 阅读 · 0 评论