chentianwei

Udacity: Intro to Relational Databases

 

 

The syntax of the select statement with a where clause:

 

select columns from tables where condition ;

keyword  + columns+  keyword +tables  + row restriction;  

Columns are separated by commas; use * to select all columns.

 

where 条件查询可以用and or not;  != 代表不等于

We can switch between the expression form (not X) and (not Y) and the form not (X or Y)

例子

select name from users where name !=\'ihower\' and name !="roy"; 

select name from users where not(name = \'ihower\') and not(name = \'roy\'); 

 

comparison operators 

< less than

> greater than

!= not equal

<= less than or equal

SQL uses = instead of == to represent equality. 


用SQL创建表格:例子: 

Create table animals (

name text,

species text,

birthdate date

); 

⚠️ :In SQL we always put string and date values inside single quotes

 


SELECT clauses 

where :表示

分类:

技术点:

相关文章:

  • 2021-10-13
  • 2021-12-23
  • 2021-12-24
  • 2021-04-27
  • 2022-12-23
  • 2021-08-16
  • 2021-05-21
猜你喜欢
  • 2021-09-30
  • 2021-12-06
  • 2022-12-23
  • 2021-05-29
  • 2021-06-07
  • 2021-12-25
  • 2022-02-18
相关资源
相似解决方案