class: center, middle, title-slide .title[ # SQL ] .subtitle[ ## PM566 - Week 11 ] .author[ ### Emil Hvitfeldt
(presented by Kelly Street) ] --- ## Acknowledgment These slides were originally developed by Emil Hvitfeldt and modified by George G. Vega Yon. --- # Plan for the week - See what relational databases are - How to query a relational database with SQL - Similarities between SQL and dplyr --- # NOTE sql is a full language with 100s of commmands. We will not be able to cover everything. We are going to look at a small sample to showcase the powers, capabilities and similarities to data.table/dplyr --- # Optional reading material .center[ ![](images/learning-sql.jpg) ] --- # Database ## Simple definition > A set of related information <br><br> Examples include: - phone book - Dictionary - Cookbook --- # Order / indexing matters The ordering of the entries will make some tasks easier and some harder. A phone book makes it easy to find a person if you know the name, but not if you only know the address Dictionaries are not helpful to find the longest words Once the book is printed then it starts going out of date --- # Hierarchical database system .center[ ![](images/hierarchical.JPG) ] --- # Network database system .center[ ![:scale 60%](images/network.JPG) ] --- # Relational database system .center[ ![:scale 50%](images/relational.JPG) ] --- All of these systems contain 4 entities - `customer` - `product` - `account` - `transaction` Each table in a relational database contains information that uniquely identifies that row in the table (Primary key) --- # Relation between tables some columns contain shared information across tables. These columns are called *foreign keys* and they serve the purpose of connecting the rows in different tables together --- ### Terminology - **Entity** Something of interest to the users - **Column** An individual peice of data stored in a table - **Row** A set of columns that together completely describe an entity or some action on an entity. Also called a **record** - **Table** A set of rows - **Result key** Another name for a non-persistent table, generally the result of a SQL query - **Primary key** One or more columns that can be used as a unique identifier for each row in a table - **Foreign key** One or more columns that can be used together to identify a single row in another table --- # What is SQL? A language created to manipulate data in relational databases. Over 40 years old. The American National Standards Institute (ANSI) have developed standards for SQL --- # A Nonprocedural Language In R we are used to being able to define variables, use conditional logic (if, if-else, while), looping/iteration and writing functions In general are we in complete control of what the code is doing. -- <br> We give up some of that when using SQL. When using SQL then we specify the input and output we desire, the this is sent to your database engine known as the **optimizer** The optimizer figures out the best way to get from input to output --- # Different databases There are different SQL databases that operate slightly different. MySQL, PostgreSQL, MariaDB, SQLite We will try to give a general overview Google is your friend All examples shown with SQLite --- # SQL query clauses - **SELECT** Determines which columns to include the query's result set - **FROM** Identifies the tables from which to retrieve data and how the tables should be joined - **WHERE** Filters out unwanted data - **GROUP BY** Used to group rows together by common column values - **HAVING** Filters out unwanted groups - **ORDER BY** Sorts the rows of the final result set by one or more columns --- # Pengiuns data
--- # Select clause ```sql SELECT species, island, bill_length_mm FROM penguins ``` ``` ## species island bill_length_mm ## 1 Adelie Torgersen 39.1 ## 2 Adelie Torgersen 39.5 ## 3 Adelie Torgersen 40.3 ## 4 Adelie Torgersen NA ## 5 Adelie Torgersen 36.7 ## 6 Adelie Torgersen 39.3 ## 7 Adelie Torgersen 38.9 ## 8 Adelie Torgersen 39.2 ## 9 Adelie Torgersen 34.1 ## 10 Adelie Torgersen 42.0 ## 11 Adelie Torgersen 37.8 ## 12 Adelie Torgersen 37.8 ## 13 Adelie Torgersen 41.1 ## 14 Adelie Torgersen 38.6 ## 15 Adelie Torgersen 34.6 ## 16 Adelie Torgersen 36.6 ## 17 Adelie Torgersen 38.7 ## 18 Adelie Torgersen 42.5 ## 19 Adelie Torgersen 34.4 ## 20 Adelie Torgersen 46.0 ## 21 Adelie Biscoe 37.8 ## 22 Adelie Biscoe 37.7 ## 23 Adelie Biscoe 35.9 ## 24 Adelie Biscoe 38.2 ## 25 Adelie Biscoe 38.8 ## 26 Adelie Biscoe 35.3 ## 27 Adelie Biscoe 40.6 ## 28 Adelie Biscoe 40.5 ## 29 Adelie Biscoe 37.9 ## 30 Adelie Biscoe 40.5 ## 31 Adelie Dream 39.5 ## 32 Adelie Dream 37.2 ## 33 Adelie Dream 39.5 ## 34 Adelie Dream 40.9 ## 35 Adelie Dream 36.4 ## 36 Adelie Dream 39.2 ## 37 Adelie Dream 38.8 ## 38 Adelie Dream 42.2 ## 39 Adelie Dream 37.6 ## 40 Adelie Dream 39.8 ## 41 Adelie Dream 36.5 ## 42 Adelie Dream 40.8 ## 43 Adelie Dream 36.0 ## 44 Adelie Dream 44.1 ## 45 Adelie Dream 37.0 ## 46 Adelie Dream 39.6 ## 47 Adelie Dream 41.1 ## 48 Adelie Dream 37.5 ## 49 Adelie Dream 36.0 ## 50 Adelie Dream 42.3 ## 51 Adelie Biscoe 39.6 ## 52 Adelie Biscoe 40.1 ## 53 Adelie Biscoe 35.0 ## 54 Adelie Biscoe 42.0 ## 55 Adelie Biscoe 34.5 ## 56 Adelie Biscoe 41.4 ## 57 Adelie Biscoe 39.0 ## 58 Adelie Biscoe 40.6 ## 59 Adelie Biscoe 36.5 ## 60 Adelie Biscoe 37.6 ## 61 Adelie Biscoe 35.7 ## 62 Adelie Biscoe 41.3 ## 63 Adelie Biscoe 37.6 ## 64 Adelie Biscoe 41.1 ## 65 Adelie Biscoe 36.4 ## 66 Adelie Biscoe 41.6 ## 67 Adelie Biscoe 35.5 ## 68 Adelie Biscoe 41.1 ## 69 Adelie Torgersen 35.9 ## 70 Adelie Torgersen 41.8 ## 71 Adelie Torgersen 33.5 ## 72 Adelie Torgersen 39.7 ## 73 Adelie Torgersen 39.6 ## 74 Adelie Torgersen 45.8 ## 75 Adelie Torgersen 35.5 ## 76 Adelie Torgersen 42.8 ## 77 Adelie Torgersen 40.9 ## 78 Adelie Torgersen 37.2 ## 79 Adelie Torgersen 36.2 ## 80 Adelie Torgersen 42.1 ## 81 Adelie Torgersen 34.6 ## 82 Adelie Torgersen 42.9 ## 83 Adelie Torgersen 36.7 ## 84 Adelie Torgersen 35.1 ## 85 Adelie Dream 37.3 ## 86 Adelie Dream 41.3 ## 87 Adelie Dream 36.3 ## 88 Adelie Dream 36.9 ## 89 Adelie Dream 38.3 ## 90 Adelie Dream 38.9 ## 91 Adelie Dream 35.7 ## 92 Adelie Dream 41.1 ## 93 Adelie Dream 34.0 ## 94 Adelie Dream 39.6 ## 95 Adelie Dream 36.2 ## 96 Adelie Dream 40.8 ## 97 Adelie Dream 38.1 ## 98 Adelie Dream 40.3 ## 99 Adelie Dream 33.1 ## 100 Adelie Dream 43.2 ## 101 Adelie Biscoe 35.0 ## 102 Adelie Biscoe 41.0 ## 103 Adelie Biscoe 37.7 ## 104 Adelie Biscoe 37.8 ## 105 Adelie Biscoe 37.9 ## 106 Adelie Biscoe 39.7 ## 107 Adelie Biscoe 38.6 ## 108 Adelie Biscoe 38.2 ## 109 Adelie Biscoe 38.1 ## 110 Adelie Biscoe 43.2 ## 111 Adelie Biscoe 38.1 ## 112 Adelie Biscoe 45.6 ## 113 Adelie Biscoe 39.7 ## 114 Adelie Biscoe 42.2 ## 115 Adelie Biscoe 39.6 ## 116 Adelie Biscoe 42.7 ## 117 Adelie Torgersen 38.6 ## 118 Adelie Torgersen 37.3 ## 119 Adelie Torgersen 35.7 ## 120 Adelie Torgersen 41.1 ## 121 Adelie Torgersen 36.2 ## 122 Adelie Torgersen 37.7 ## 123 Adelie Torgersen 40.2 ## 124 Adelie Torgersen 41.4 ## 125 Adelie Torgersen 35.2 ## 126 Adelie Torgersen 40.6 ## 127 Adelie Torgersen 38.8 ## 128 Adelie Torgersen 41.5 ## 129 Adelie Torgersen 39.0 ## 130 Adelie Torgersen 44.1 ## 131 Adelie Torgersen 38.5 ## 132 Adelie Torgersen 43.1 ## 133 Adelie Dream 36.8 ## 134 Adelie Dream 37.5 ## 135 Adelie Dream 38.1 ## 136 Adelie Dream 41.1 ## 137 Adelie Dream 35.6 ## 138 Adelie Dream 40.2 ## 139 Adelie Dream 37.0 ## 140 Adelie Dream 39.7 ## 141 Adelie Dream 40.2 ## 142 Adelie Dream 40.6 ## 143 Adelie Dream 32.1 ## 144 Adelie Dream 40.7 ## 145 Adelie Dream 37.3 ## 146 Adelie Dream 39.0 ## 147 Adelie Dream 39.2 ## 148 Adelie Dream 36.6 ## 149 Adelie Dream 36.0 ## 150 Adelie Dream 37.8 ## 151 Adelie Dream 36.0 ## 152 Adelie Dream 41.5 ## 153 Gentoo Biscoe 46.1 ## 154 Gentoo Biscoe 50.0 ## 155 Gentoo Biscoe 48.7 ## 156 Gentoo Biscoe 50.0 ## 157 Gentoo Biscoe 47.6 ## 158 Gentoo Biscoe 46.5 ## 159 Gentoo Biscoe 45.4 ## 160 Gentoo Biscoe 46.7 ## 161 Gentoo Biscoe 43.3 ## 162 Gentoo Biscoe 46.8 ## 163 Gentoo Biscoe 40.9 ## 164 Gentoo Biscoe 49.0 ## 165 Gentoo Biscoe 45.5 ## 166 Gentoo Biscoe 48.4 ## 167 Gentoo Biscoe 45.8 ## 168 Gentoo Biscoe 49.3 ## 169 Gentoo Biscoe 42.0 ## 170 Gentoo Biscoe 49.2 ## 171 Gentoo Biscoe 46.2 ## 172 Gentoo Biscoe 48.7 ## 173 Gentoo Biscoe 50.2 ## 174 Gentoo Biscoe 45.1 ## 175 Gentoo Biscoe 46.5 ## 176 Gentoo Biscoe 46.3 ## 177 Gentoo Biscoe 42.9 ## 178 Gentoo Biscoe 46.1 ## 179 Gentoo Biscoe 44.5 ## 180 Gentoo Biscoe 47.8 ## 181 Gentoo Biscoe 48.2 ## 182 Gentoo Biscoe 50.0 ## 183 Gentoo Biscoe 47.3 ## 184 Gentoo Biscoe 42.8 ## 185 Gentoo Biscoe 45.1 ## 186 Gentoo Biscoe 59.6 ## 187 Gentoo Biscoe 49.1 ## 188 Gentoo Biscoe 48.4 ## 189 Gentoo Biscoe 42.6 ## 190 Gentoo Biscoe 44.4 ## 191 Gentoo Biscoe 44.0 ## 192 Gentoo Biscoe 48.7 ## 193 Gentoo Biscoe 42.7 ## 194 Gentoo Biscoe 49.6 ## 195 Gentoo Biscoe 45.3 ## 196 Gentoo Biscoe 49.6 ## 197 Gentoo Biscoe 50.5 ## 198 Gentoo Biscoe 43.6 ## 199 Gentoo Biscoe 45.5 ## 200 Gentoo Biscoe 50.5 ## 201 Gentoo Biscoe 44.9 ## 202 Gentoo Biscoe 45.2 ## 203 Gentoo Biscoe 46.6 ## 204 Gentoo Biscoe 48.5 ## 205 Gentoo Biscoe 45.1 ## 206 Gentoo Biscoe 50.1 ## 207 Gentoo Biscoe 46.5 ## 208 Gentoo Biscoe 45.0 ## 209 Gentoo Biscoe 43.8 ## 210 Gentoo Biscoe 45.5 ## 211 Gentoo Biscoe 43.2 ## 212 Gentoo Biscoe 50.4 ## 213 Gentoo Biscoe 45.3 ## 214 Gentoo Biscoe 46.2 ## 215 Gentoo Biscoe 45.7 ## 216 Gentoo Biscoe 54.3 ## 217 Gentoo Biscoe 45.8 ## 218 Gentoo Biscoe 49.8 ## 219 Gentoo Biscoe 46.2 ## 220 Gentoo Biscoe 49.5 ## 221 Gentoo Biscoe 43.5 ## 222 Gentoo Biscoe 50.7 ## 223 Gentoo Biscoe 47.7 ## 224 Gentoo Biscoe 46.4 ## 225 Gentoo Biscoe 48.2 ## 226 Gentoo Biscoe 46.5 ## 227 Gentoo Biscoe 46.4 ## 228 Gentoo Biscoe 48.6 ## 229 Gentoo Biscoe 47.5 ## 230 Gentoo Biscoe 51.1 ## 231 Gentoo Biscoe 45.2 ## 232 Gentoo Biscoe 45.2 ## 233 Gentoo Biscoe 49.1 ## 234 Gentoo Biscoe 52.5 ## 235 Gentoo Biscoe 47.4 ## 236 Gentoo Biscoe 50.0 ## 237 Gentoo Biscoe 44.9 ## 238 Gentoo Biscoe 50.8 ## 239 Gentoo Biscoe 43.4 ## 240 Gentoo Biscoe 51.3 ## 241 Gentoo Biscoe 47.5 ## 242 Gentoo Biscoe 52.1 ## 243 Gentoo Biscoe 47.5 ## 244 Gentoo Biscoe 52.2 ## 245 Gentoo Biscoe 45.5 ## 246 Gentoo Biscoe 49.5 ## 247 Gentoo Biscoe 44.5 ## 248 Gentoo Biscoe 50.8 ## 249 Gentoo Biscoe 49.4 ## 250 Gentoo Biscoe 46.9 ## 251 Gentoo Biscoe 48.4 ## 252 Gentoo Biscoe 51.1 ## 253 Gentoo Biscoe 48.5 ## 254 Gentoo Biscoe 55.9 ## 255 Gentoo Biscoe 47.2 ## 256 Gentoo Biscoe 49.1 ## 257 Gentoo Biscoe 47.3 ## 258 Gentoo Biscoe 46.8 ## 259 Gentoo Biscoe 41.7 ## 260 Gentoo Biscoe 53.4 ## 261 Gentoo Biscoe 43.3 ## 262 Gentoo Biscoe 48.1 ## 263 Gentoo Biscoe 50.5 ## 264 Gentoo Biscoe 49.8 ## 265 Gentoo Biscoe 43.5 ## 266 Gentoo Biscoe 51.5 ## 267 Gentoo Biscoe 46.2 ## 268 Gentoo Biscoe 55.1 ## 269 Gentoo Biscoe 44.5 ## 270 Gentoo Biscoe 48.8 ## 271 Gentoo Biscoe 47.2 ## 272 Gentoo Biscoe NA ## 273 Gentoo Biscoe 46.8 ## 274 Gentoo Biscoe 50.4 ## 275 Gentoo Biscoe 45.2 ## 276 Gentoo Biscoe 49.9 ## 277 Chinstrap Dream 46.5 ## 278 Chinstrap Dream 50.0 ## 279 Chinstrap Dream 51.3 ## 280 Chinstrap Dream 45.4 ## 281 Chinstrap Dream 52.7 ## 282 Chinstrap Dream 45.2 ## 283 Chinstrap Dream 46.1 ## 284 Chinstrap Dream 51.3 ## 285 Chinstrap Dream 46.0 ## 286 Chinstrap Dream 51.3 ## 287 Chinstrap Dream 46.6 ## 288 Chinstrap Dream 51.7 ## 289 Chinstrap Dream 47.0 ## 290 Chinstrap Dream 52.0 ## 291 Chinstrap Dream 45.9 ## 292 Chinstrap Dream 50.5 ## 293 Chinstrap Dream 50.3 ## 294 Chinstrap Dream 58.0 ## 295 Chinstrap Dream 46.4 ## 296 Chinstrap Dream 49.2 ## 297 Chinstrap Dream 42.4 ## 298 Chinstrap Dream 48.5 ## 299 Chinstrap Dream 43.2 ## 300 Chinstrap Dream 50.6 ## 301 Chinstrap Dream 46.7 ## 302 Chinstrap Dream 52.0 ## 303 Chinstrap Dream 50.5 ## 304 Chinstrap Dream 49.5 ## 305 Chinstrap Dream 46.4 ## 306 Chinstrap Dream 52.8 ## 307 Chinstrap Dream 40.9 ## 308 Chinstrap Dream 54.2 ## 309 Chinstrap Dream 42.5 ## 310 Chinstrap Dream 51.0 ## 311 Chinstrap Dream 49.7 ## 312 Chinstrap Dream 47.5 ## 313 Chinstrap Dream 47.6 ## 314 Chinstrap Dream 52.0 ## 315 Chinstrap Dream 46.9 ## 316 Chinstrap Dream 53.5 ## 317 Chinstrap Dream 49.0 ## 318 Chinstrap Dream 46.2 ## 319 Chinstrap Dream 50.9 ## 320 Chinstrap Dream 45.5 ## 321 Chinstrap Dream 50.9 ## 322 Chinstrap Dream 50.8 ## 323 Chinstrap Dream 50.1 ## 324 Chinstrap Dream 49.0 ## 325 Chinstrap Dream 51.5 ## 326 Chinstrap Dream 49.8 ## 327 Chinstrap Dream 48.1 ## 328 Chinstrap Dream 51.4 ## 329 Chinstrap Dream 45.7 ## 330 Chinstrap Dream 50.7 ## 331 Chinstrap Dream 42.5 ## 332 Chinstrap Dream 52.2 ## 333 Chinstrap Dream 45.2 ## 334 Chinstrap Dream 49.3 ## 335 Chinstrap Dream 50.2 ## 336 Chinstrap Dream 45.6 ## 337 Chinstrap Dream 51.9 ## 338 Chinstrap Dream 46.8 ## 339 Chinstrap Dream 45.7 ## 340 Chinstrap Dream 55.8 ## 341 Chinstrap Dream 43.5 ## 342 Chinstrap Dream 49.6 ## 343 Chinstrap Dream 50.8 ## 344 Chinstrap Dream 50.2 ``` --- # Select clause ```sql SELECT * FROM penguins ``` ``` ## species island bill_length_mm bill_depth_mm flipper_length_mm ## 1 Adelie Torgersen 39.1 18.7 181 ## 2 Adelie Torgersen 39.5 17.4 186 ## 3 Adelie Torgersen 40.3 18.0 195 ## 4 Adelie Torgersen NA NA NA ## 5 Adelie Torgersen 36.7 19.3 193 ## 6 Adelie Torgersen 39.3 20.6 190 ## 7 Adelie Torgersen 38.9 17.8 181 ## 8 Adelie Torgersen 39.2 19.6 195 ## 9 Adelie Torgersen 34.1 18.1 193 ## 10 Adelie Torgersen 42.0 20.2 190 ## 11 Adelie Torgersen 37.8 17.1 186 ## 12 Adelie Torgersen 37.8 17.3 180 ## 13 Adelie Torgersen 41.1 17.6 182 ## 14 Adelie Torgersen 38.6 21.2 191 ## 15 Adelie Torgersen 34.6 21.1 198 ## 16 Adelie Torgersen 36.6 17.8 185 ## 17 Adelie Torgersen 38.7 19.0 195 ## 18 Adelie Torgersen 42.5 20.7 197 ## 19 Adelie Torgersen 34.4 18.4 184 ## 20 Adelie Torgersen 46.0 21.5 194 ## 21 Adelie Biscoe 37.8 18.3 174 ## 22 Adelie Biscoe 37.7 18.7 180 ## 23 Adelie Biscoe 35.9 19.2 189 ## 24 Adelie Biscoe 38.2 18.1 185 ## 25 Adelie Biscoe 38.8 17.2 180 ## 26 Adelie Biscoe 35.3 18.9 187 ## 27 Adelie Biscoe 40.6 18.6 183 ## 28 Adelie Biscoe 40.5 17.9 187 ## 29 Adelie Biscoe 37.9 18.6 172 ## 30 Adelie Biscoe 40.5 18.9 180 ## 31 Adelie Dream 39.5 16.7 178 ## 32 Adelie Dream 37.2 18.1 178 ## 33 Adelie Dream 39.5 17.8 188 ## 34 Adelie Dream 40.9 18.9 184 ## 35 Adelie Dream 36.4 17.0 195 ## 36 Adelie Dream 39.2 21.1 196 ## 37 Adelie Dream 38.8 20.0 190 ## 38 Adelie Dream 42.2 18.5 180 ## 39 Adelie Dream 37.6 19.3 181 ## 40 Adelie Dream 39.8 19.1 184 ## 41 Adelie Dream 36.5 18.0 182 ## 42 Adelie Dream 40.8 18.4 195 ## 43 Adelie Dream 36.0 18.5 186 ## 44 Adelie Dream 44.1 19.7 196 ## 45 Adelie Dream 37.0 16.9 185 ## 46 Adelie Dream 39.6 18.8 190 ## 47 Adelie Dream 41.1 19.0 182 ## 48 Adelie Dream 37.5 18.9 179 ## 49 Adelie Dream 36.0 17.9 190 ## 50 Adelie Dream 42.3 21.2 191 ## 51 Adelie Biscoe 39.6 17.7 186 ## 52 Adelie Biscoe 40.1 18.9 188 ## 53 Adelie Biscoe 35.0 17.9 190 ## 54 Adelie Biscoe 42.0 19.5 200 ## 55 Adelie Biscoe 34.5 18.1 187 ## 56 Adelie Biscoe 41.4 18.6 191 ## 57 Adelie Biscoe 39.0 17.5 186 ## 58 Adelie Biscoe 40.6 18.8 193 ## 59 Adelie Biscoe 36.5 16.6 181 ## 60 Adelie Biscoe 37.6 19.1 194 ## 61 Adelie Biscoe 35.7 16.9 185 ## 62 Adelie Biscoe 41.3 21.1 195 ## 63 Adelie Biscoe 37.6 17.0 185 ## 64 Adelie Biscoe 41.1 18.2 192 ## 65 Adelie Biscoe 36.4 17.1 184 ## 66 Adelie Biscoe 41.6 18.0 192 ## 67 Adelie Biscoe 35.5 16.2 195 ## 68 Adelie Biscoe 41.1 19.1 188 ## 69 Adelie Torgersen 35.9 16.6 190 ## 70 Adelie Torgersen 41.8 19.4 198 ## 71 Adelie Torgersen 33.5 19.0 190 ## 72 Adelie Torgersen 39.7 18.4 190 ## 73 Adelie Torgersen 39.6 17.2 196 ## 74 Adelie Torgersen 45.8 18.9 197 ## 75 Adelie Torgersen 35.5 17.5 190 ## 76 Adelie Torgersen 42.8 18.5 195 ## 77 Adelie Torgersen 40.9 16.8 191 ## 78 Adelie Torgersen 37.2 19.4 184 ## 79 Adelie Torgersen 36.2 16.1 187 ## 80 Adelie Torgersen 42.1 19.1 195 ## 81 Adelie Torgersen 34.6 17.2 189 ## 82 Adelie Torgersen 42.9 17.6 196 ## 83 Adelie Torgersen 36.7 18.8 187 ## 84 Adelie Torgersen 35.1 19.4 193 ## 85 Adelie Dream 37.3 17.8 191 ## 86 Adelie Dream 41.3 20.3 194 ## 87 Adelie Dream 36.3 19.5 190 ## 88 Adelie Dream 36.9 18.6 189 ## 89 Adelie Dream 38.3 19.2 189 ## 90 Adelie Dream 38.9 18.8 190 ## 91 Adelie Dream 35.7 18.0 202 ## 92 Adelie Dream 41.1 18.1 205 ## 93 Adelie Dream 34.0 17.1 185 ## 94 Adelie Dream 39.6 18.1 186 ## 95 Adelie Dream 36.2 17.3 187 ## 96 Adelie Dream 40.8 18.9 208 ## 97 Adelie Dream 38.1 18.6 190 ## 98 Adelie Dream 40.3 18.5 196 ## 99 Adelie Dream 33.1 16.1 178 ## 100 Adelie Dream 43.2 18.5 192 ## 101 Adelie Biscoe 35.0 17.9 192 ## 102 Adelie Biscoe 41.0 20.0 203 ## 103 Adelie Biscoe 37.7 16.0 183 ## 104 Adelie Biscoe 37.8 20.0 190 ## 105 Adelie Biscoe 37.9 18.6 193 ## 106 Adelie Biscoe 39.7 18.9 184 ## 107 Adelie Biscoe 38.6 17.2 199 ## 108 Adelie Biscoe 38.2 20.0 190 ## 109 Adelie Biscoe 38.1 17.0 181 ## 110 Adelie Biscoe 43.2 19.0 197 ## 111 Adelie Biscoe 38.1 16.5 198 ## 112 Adelie Biscoe 45.6 20.3 191 ## 113 Adelie Biscoe 39.7 17.7 193 ## 114 Adelie Biscoe 42.2 19.5 197 ## 115 Adelie Biscoe 39.6 20.7 191 ## 116 Adelie Biscoe 42.7 18.3 196 ## 117 Adelie Torgersen 38.6 17.0 188 ## 118 Adelie Torgersen 37.3 20.5 199 ## 119 Adelie Torgersen 35.7 17.0 189 ## 120 Adelie Torgersen 41.1 18.6 189 ## 121 Adelie Torgersen 36.2 17.2 187 ## 122 Adelie Torgersen 37.7 19.8 198 ## 123 Adelie Torgersen 40.2 17.0 176 ## 124 Adelie Torgersen 41.4 18.5 202 ## 125 Adelie Torgersen 35.2 15.9 186 ## 126 Adelie Torgersen 40.6 19.0 199 ## 127 Adelie Torgersen 38.8 17.6 191 ## 128 Adelie Torgersen 41.5 18.3 195 ## 129 Adelie Torgersen 39.0 17.1 191 ## 130 Adelie Torgersen 44.1 18.0 210 ## 131 Adelie Torgersen 38.5 17.9 190 ## 132 Adelie Torgersen 43.1 19.2 197 ## 133 Adelie Dream 36.8 18.5 193 ## 134 Adelie Dream 37.5 18.5 199 ## 135 Adelie Dream 38.1 17.6 187 ## 136 Adelie Dream 41.1 17.5 190 ## 137 Adelie Dream 35.6 17.5 191 ## 138 Adelie Dream 40.2 20.1 200 ## 139 Adelie Dream 37.0 16.5 185 ## 140 Adelie Dream 39.7 17.9 193 ## 141 Adelie Dream 40.2 17.1 193 ## 142 Adelie Dream 40.6 17.2 187 ## 143 Adelie Dream 32.1 15.5 188 ## 144 Adelie Dream 40.7 17.0 190 ## 145 Adelie Dream 37.3 16.8 192 ## 146 Adelie Dream 39.0 18.7 185 ## 147 Adelie Dream 39.2 18.6 190 ## 148 Adelie Dream 36.6 18.4 184 ## 149 Adelie Dream 36.0 17.8 195 ## 150 Adelie Dream 37.8 18.1 193 ## 151 Adelie Dream 36.0 17.1 187 ## 152 Adelie Dream 41.5 18.5 201 ## 153 Gentoo Biscoe 46.1 13.2 211 ## 154 Gentoo Biscoe 50.0 16.3 230 ## 155 Gentoo Biscoe 48.7 14.1 210 ## 156 Gentoo Biscoe 50.0 15.2 218 ## 157 Gentoo Biscoe 47.6 14.5 215 ## 158 Gentoo Biscoe 46.5 13.5 210 ## 159 Gentoo Biscoe 45.4 14.6 211 ## 160 Gentoo Biscoe 46.7 15.3 219 ## 161 Gentoo Biscoe 43.3 13.4 209 ## 162 Gentoo Biscoe 46.8 15.4 215 ## 163 Gentoo Biscoe 40.9 13.7 214 ## 164 Gentoo Biscoe 49.0 16.1 216 ## 165 Gentoo Biscoe 45.5 13.7 214 ## 166 Gentoo Biscoe 48.4 14.6 213 ## 167 Gentoo Biscoe 45.8 14.6 210 ## 168 Gentoo Biscoe 49.3 15.7 217 ## 169 Gentoo Biscoe 42.0 13.5 210 ## 170 Gentoo Biscoe 49.2 15.2 221 ## 171 Gentoo Biscoe 46.2 14.5 209 ## 172 Gentoo Biscoe 48.7 15.1 222 ## 173 Gentoo Biscoe 50.2 14.3 218 ## 174 Gentoo Biscoe 45.1 14.5 215 ## 175 Gentoo Biscoe 46.5 14.5 213 ## 176 Gentoo Biscoe 46.3 15.8 215 ## 177 Gentoo Biscoe 42.9 13.1 215 ## 178 Gentoo Biscoe 46.1 15.1 215 ## 179 Gentoo Biscoe 44.5 14.3 216 ## 180 Gentoo Biscoe 47.8 15.0 215 ## 181 Gentoo Biscoe 48.2 14.3 210 ## 182 Gentoo Biscoe 50.0 15.3 220 ## 183 Gentoo Biscoe 47.3 15.3 222 ## 184 Gentoo Biscoe 42.8 14.2 209 ## 185 Gentoo Biscoe 45.1 14.5 207 ## 186 Gentoo Biscoe 59.6 17.0 230 ## 187 Gentoo Biscoe 49.1 14.8 220 ## 188 Gentoo Biscoe 48.4 16.3 220 ## 189 Gentoo Biscoe 42.6 13.7 213 ## 190 Gentoo Biscoe 44.4 17.3 219 ## 191 Gentoo Biscoe 44.0 13.6 208 ## 192 Gentoo Biscoe 48.7 15.7 208 ## 193 Gentoo Biscoe 42.7 13.7 208 ## 194 Gentoo Biscoe 49.6 16.0 225 ## 195 Gentoo Biscoe 45.3 13.7 210 ## 196 Gentoo Biscoe 49.6 15.0 216 ## 197 Gentoo Biscoe 50.5 15.9 222 ## 198 Gentoo Biscoe 43.6 13.9 217 ## 199 Gentoo Biscoe 45.5 13.9 210 ## 200 Gentoo Biscoe 50.5 15.9 225 ## 201 Gentoo Biscoe 44.9 13.3 213 ## 202 Gentoo Biscoe 45.2 15.8 215 ## 203 Gentoo Biscoe 46.6 14.2 210 ## 204 Gentoo Biscoe 48.5 14.1 220 ## 205 Gentoo Biscoe 45.1 14.4 210 ## 206 Gentoo Biscoe 50.1 15.0 225 ## 207 Gentoo Biscoe 46.5 14.4 217 ## 208 Gentoo Biscoe 45.0 15.4 220 ## 209 Gentoo Biscoe 43.8 13.9 208 ## 210 Gentoo Biscoe 45.5 15.0 220 ## 211 Gentoo Biscoe 43.2 14.5 208 ## 212 Gentoo Biscoe 50.4 15.3 224 ## 213 Gentoo Biscoe 45.3 13.8 208 ## 214 Gentoo Biscoe 46.2 14.9 221 ## 215 Gentoo Biscoe 45.7 13.9 214 ## 216 Gentoo Biscoe 54.3 15.7 231 ## 217 Gentoo Biscoe 45.8 14.2 219 ## 218 Gentoo Biscoe 49.8 16.8 230 ## 219 Gentoo Biscoe 46.2 14.4 214 ## 220 Gentoo Biscoe 49.5 16.2 229 ## 221 Gentoo Biscoe 43.5 14.2 220 ## 222 Gentoo Biscoe 50.7 15.0 223 ## 223 Gentoo Biscoe 47.7 15.0 216 ## 224 Gentoo Biscoe 46.4 15.6 221 ## 225 Gentoo Biscoe 48.2 15.6 221 ## 226 Gentoo Biscoe 46.5 14.8 217 ## 227 Gentoo Biscoe 46.4 15.0 216 ## 228 Gentoo Biscoe 48.6 16.0 230 ## 229 Gentoo Biscoe 47.5 14.2 209 ## 230 Gentoo Biscoe 51.1 16.3 220 ## 231 Gentoo Biscoe 45.2 13.8 215 ## 232 Gentoo Biscoe 45.2 16.4 223 ## 233 Gentoo Biscoe 49.1 14.5 212 ## 234 Gentoo Biscoe 52.5 15.6 221 ## 235 Gentoo Biscoe 47.4 14.6 212 ## 236 Gentoo Biscoe 50.0 15.9 224 ## 237 Gentoo Biscoe 44.9 13.8 212 ## 238 Gentoo Biscoe 50.8 17.3 228 ## 239 Gentoo Biscoe 43.4 14.4 218 ## 240 Gentoo Biscoe 51.3 14.2 218 ## 241 Gentoo Biscoe 47.5 14.0 212 ## 242 Gentoo Biscoe 52.1 17.0 230 ## 243 Gentoo Biscoe 47.5 15.0 218 ## 244 Gentoo Biscoe 52.2 17.1 228 ## 245 Gentoo Biscoe 45.5 14.5 212 ## 246 Gentoo Biscoe 49.5 16.1 224 ## 247 Gentoo Biscoe 44.5 14.7 214 ## 248 Gentoo Biscoe 50.8 15.7 226 ## 249 Gentoo Biscoe 49.4 15.8 216 ## 250 Gentoo Biscoe 46.9 14.6 222 ## 251 Gentoo Biscoe 48.4 14.4 203 ## 252 Gentoo Biscoe 51.1 16.5 225 ## 253 Gentoo Biscoe 48.5 15.0 219 ## 254 Gentoo Biscoe 55.9 17.0 228 ## 255 Gentoo Biscoe 47.2 15.5 215 ## 256 Gentoo Biscoe 49.1 15.0 228 ## 257 Gentoo Biscoe 47.3 13.8 216 ## 258 Gentoo Biscoe 46.8 16.1 215 ## 259 Gentoo Biscoe 41.7 14.7 210 ## 260 Gentoo Biscoe 53.4 15.8 219 ## 261 Gentoo Biscoe 43.3 14.0 208 ## 262 Gentoo Biscoe 48.1 15.1 209 ## 263 Gentoo Biscoe 50.5 15.2 216 ## 264 Gentoo Biscoe 49.8 15.9 229 ## 265 Gentoo Biscoe 43.5 15.2 213 ## 266 Gentoo Biscoe 51.5 16.3 230 ## 267 Gentoo Biscoe 46.2 14.1 217 ## 268 Gentoo Biscoe 55.1 16.0 230 ## 269 Gentoo Biscoe 44.5 15.7 217 ## 270 Gentoo Biscoe 48.8 16.2 222 ## 271 Gentoo Biscoe 47.2 13.7 214 ## 272 Gentoo Biscoe NA NA NA ## 273 Gentoo Biscoe 46.8 14.3 215 ## 274 Gentoo Biscoe 50.4 15.7 222 ## 275 Gentoo Biscoe 45.2 14.8 212 ## 276 Gentoo Biscoe 49.9 16.1 213 ## 277 Chinstrap Dream 46.5 17.9 192 ## 278 Chinstrap Dream 50.0 19.5 196 ## 279 Chinstrap Dream 51.3 19.2 193 ## 280 Chinstrap Dream 45.4 18.7 188 ## 281 Chinstrap Dream 52.7 19.8 197 ## 282 Chinstrap Dream 45.2 17.8 198 ## 283 Chinstrap Dream 46.1 18.2 178 ## 284 Chinstrap Dream 51.3 18.2 197 ## 285 Chinstrap Dream 46.0 18.9 195 ## 286 Chinstrap Dream 51.3 19.9 198 ## 287 Chinstrap Dream 46.6 17.8 193 ## 288 Chinstrap Dream 51.7 20.3 194 ## 289 Chinstrap Dream 47.0 17.3 185 ## 290 Chinstrap Dream 52.0 18.1 201 ## 291 Chinstrap Dream 45.9 17.1 190 ## 292 Chinstrap Dream 50.5 19.6 201 ## 293 Chinstrap Dream 50.3 20.0 197 ## 294 Chinstrap Dream 58.0 17.8 181 ## 295 Chinstrap Dream 46.4 18.6 190 ## 296 Chinstrap Dream 49.2 18.2 195 ## 297 Chinstrap Dream 42.4 17.3 181 ## 298 Chinstrap Dream 48.5 17.5 191 ## 299 Chinstrap Dream 43.2 16.6 187 ## 300 Chinstrap Dream 50.6 19.4 193 ## 301 Chinstrap Dream 46.7 17.9 195 ## 302 Chinstrap Dream 52.0 19.0 197 ## 303 Chinstrap Dream 50.5 18.4 200 ## 304 Chinstrap Dream 49.5 19.0 200 ## 305 Chinstrap Dream 46.4 17.8 191 ## 306 Chinstrap Dream 52.8 20.0 205 ## 307 Chinstrap Dream 40.9 16.6 187 ## 308 Chinstrap Dream 54.2 20.8 201 ## 309 Chinstrap Dream 42.5 16.7 187 ## 310 Chinstrap Dream 51.0 18.8 203 ## 311 Chinstrap Dream 49.7 18.6 195 ## 312 Chinstrap Dream 47.5 16.8 199 ## 313 Chinstrap Dream 47.6 18.3 195 ## 314 Chinstrap Dream 52.0 20.7 210 ## 315 Chinstrap Dream 46.9 16.6 192 ## 316 Chinstrap Dream 53.5 19.9 205 ## 317 Chinstrap Dream 49.0 19.5 210 ## 318 Chinstrap Dream 46.2 17.5 187 ## 319 Chinstrap Dream 50.9 19.1 196 ## 320 Chinstrap Dream 45.5 17.0 196 ## 321 Chinstrap Dream 50.9 17.9 196 ## 322 Chinstrap Dream 50.8 18.5 201 ## 323 Chinstrap Dream 50.1 17.9 190 ## 324 Chinstrap Dream 49.0 19.6 212 ## 325 Chinstrap Dream 51.5 18.7 187 ## 326 Chinstrap Dream 49.8 17.3 198 ## 327 Chinstrap Dream 48.1 16.4 199 ## 328 Chinstrap Dream 51.4 19.0 201 ## 329 Chinstrap Dream 45.7 17.3 193 ## 330 Chinstrap Dream 50.7 19.7 203 ## 331 Chinstrap Dream 42.5 17.3 187 ## 332 Chinstrap Dream 52.2 18.8 197 ## 333 Chinstrap Dream 45.2 16.6 191 ## 334 Chinstrap Dream 49.3 19.9 203 ## 335 Chinstrap Dream 50.2 18.8 202 ## 336 Chinstrap Dream 45.6 19.4 194 ## 337 Chinstrap Dream 51.9 19.5 206 ## 338 Chinstrap Dream 46.8 16.5 189 ## 339 Chinstrap Dream 45.7 17.0 195 ## 340 Chinstrap Dream 55.8 19.8 207 ## 341 Chinstrap Dream 43.5 18.1 202 ## 342 Chinstrap Dream 49.6 18.2 193 ## 343 Chinstrap Dream 50.8 19.0 210 ## 344 Chinstrap Dream 50.2 18.7 198 ## body_mass_g sex year ## 1 3750 male 2007 ## 2 3800 female 2007 ## 3 3250 female 2007 ## 4 NA <NA> 2007 ## 5 3450 female 2007 ## 6 3650 male 2007 ## 7 3625 female 2007 ## 8 4675 male 2007 ## 9 3475 <NA> 2007 ## 10 4250 <NA> 2007 ## 11 3300 <NA> 2007 ## 12 3700 <NA> 2007 ## 13 3200 female 2007 ## 14 3800 male 2007 ## 15 4400 male 2007 ## 16 3700 female 2007 ## 17 3450 female 2007 ## 18 4500 male 2007 ## 19 3325 female 2007 ## 20 4200 male 2007 ## 21 3400 female 2007 ## 22 3600 male 2007 ## 23 3800 female 2007 ## 24 3950 male 2007 ## 25 3800 male 2007 ## 26 3800 female 2007 ## 27 3550 male 2007 ## 28 3200 female 2007 ## 29 3150 female 2007 ## 30 3950 male 2007 ## 31 3250 female 2007 ## 32 3900 male 2007 ## 33 3300 female 2007 ## 34 3900 male 2007 ## 35 3325 female 2007 ## 36 4150 male 2007 ## 37 3950 male 2007 ## 38 3550 female 2007 ## 39 3300 female 2007 ## 40 4650 male 2007 ## 41 3150 female 2007 ## 42 3900 male 2007 ## 43 3100 female 2007 ## 44 4400 male 2007 ## 45 3000 female 2007 ## 46 4600 male 2007 ## 47 3425 male 2007 ## 48 2975 <NA> 2007 ## 49 3450 female 2007 ## 50 4150 male 2007 ## 51 3500 female 2008 ## 52 4300 male 2008 ## 53 3450 female 2008 ## 54 4050 male 2008 ## 55 2900 female 2008 ## 56 3700 male 2008 ## 57 3550 female 2008 ## 58 3800 male 2008 ## 59 2850 female 2008 ## 60 3750 male 2008 ## 61 3150 female 2008 ## 62 4400 male 2008 ## 63 3600 female 2008 ## 64 4050 male 2008 ## 65 2850 female 2008 ## 66 3950 male 2008 ## 67 3350 female 2008 ## 68 4100 male 2008 ## 69 3050 female 2008 ## 70 4450 male 2008 ## 71 3600 female 2008 ## 72 3900 male 2008 ## 73 3550 female 2008 ## 74 4150 male 2008 ## 75 3700 female 2008 ## 76 4250 male 2008 ## 77 3700 female 2008 ## 78 3900 male 2008 ## 79 3550 female 2008 ## 80 4000 male 2008 ## 81 3200 female 2008 ## 82 4700 male 2008 ## 83 3800 female 2008 ## 84 4200 male 2008 ## 85 3350 female 2008 ## 86 3550 male 2008 ## 87 3800 male 2008 ## 88 3500 female 2008 ## 89 3950 male 2008 ## 90 3600 female 2008 ## 91 3550 female 2008 ## 92 4300 male 2008 ## 93 3400 female 2008 ## 94 4450 male 2008 ## 95 3300 female 2008 ## 96 4300 male 2008 ## 97 3700 female 2008 ## 98 4350 male 2008 ## 99 2900 female 2008 ## 100 4100 male 2008 ## 101 3725 female 2009 ## 102 4725 male 2009 ## 103 3075 female 2009 ## 104 4250 male 2009 ## 105 2925 female 2009 ## 106 3550 male 2009 ## 107 3750 female 2009 ## 108 3900 male 2009 ## 109 3175 female 2009 ## 110 4775 male 2009 ## 111 3825 female 2009 ## 112 4600 male 2009 ## 113 3200 female 2009 ## 114 4275 male 2009 ## 115 3900 female 2009 ## 116 4075 male 2009 ## 117 2900 female 2009 ## 118 3775 male 2009 ## 119 3350 female 2009 ## 120 3325 male 2009 ## 121 3150 female 2009 ## 122 3500 male 2009 ## 123 3450 female 2009 ## 124 3875 male 2009 ## 125 3050 female 2009 ## 126 4000 male 2009 ## 127 3275 female 2009 ## 128 4300 male 2009 ## 129 3050 female 2009 ## 130 4000 male 2009 ## 131 3325 female 2009 ## 132 3500 male 2009 ## 133 3500 female 2009 ## 134 4475 male 2009 ## 135 3425 female 2009 ## 136 3900 male 2009 ## 137 3175 female 2009 ## 138 3975 male 2009 ## 139 3400 female 2009 ## 140 4250 male 2009 ## 141 3400 female 2009 ## 142 3475 male 2009 ## 143 3050 female 2009 ## 144 3725 male 2009 ## 145 3000 female 2009 ## 146 3650 male 2009 ## 147 4250 male 2009 ## 148 3475 female 2009 ## 149 3450 female 2009 ## 150 3750 male 2009 ## 151 3700 female 2009 ## 152 4000 male 2009 ## 153 4500 female 2007 ## 154 5700 male 2007 ## 155 4450 female 2007 ## 156 5700 male 2007 ## 157 5400 male 2007 ## 158 4550 female 2007 ## 159 4800 female 2007 ## 160 5200 male 2007 ## 161 4400 female 2007 ## 162 5150 male 2007 ## 163 4650 female 2007 ## 164 5550 male 2007 ## 165 4650 female 2007 ## 166 5850 male 2007 ## 167 4200 female 2007 ## 168 5850 male 2007 ## 169 4150 female 2007 ## 170 6300 male 2007 ## 171 4800 female 2007 ## 172 5350 male 2007 ## 173 5700 male 2007 ## 174 5000 female 2007 ## 175 4400 female 2007 ## 176 5050 male 2007 ## 177 5000 female 2007 ## 178 5100 male 2007 ## 179 4100 <NA> 2007 ## 180 5650 male 2007 ## 181 4600 female 2007 ## 182 5550 male 2007 ## 183 5250 male 2007 ## 184 4700 female 2007 ## 185 5050 female 2007 ## 186 6050 male 2007 ## 187 5150 female 2008 ## 188 5400 male 2008 ## 189 4950 female 2008 ## 190 5250 male 2008 ## 191 4350 female 2008 ## 192 5350 male 2008 ## 193 3950 female 2008 ## 194 5700 male 2008 ## 195 4300 female 2008 ## 196 4750 male 2008 ## 197 5550 male 2008 ## 198 4900 female 2008 ## 199 4200 female 2008 ## 200 5400 male 2008 ## 201 5100 female 2008 ## 202 5300 male 2008 ## 203 4850 female 2008 ## 204 5300 male 2008 ## 205 4400 female 2008 ## 206 5000 male 2008 ## 207 4900 female 2008 ## 208 5050 male 2008 ## 209 4300 female 2008 ## 210 5000 male 2008 ## 211 4450 female 2008 ## 212 5550 male 2008 ## 213 4200 female 2008 ## 214 5300 male 2008 ## 215 4400 female 2008 ## 216 5650 male 2008 ## 217 4700 female 2008 ## 218 5700 male 2008 ## 219 4650 <NA> 2008 ## 220 5800 male 2008 ## 221 4700 female 2008 ## 222 5550 male 2008 ## 223 4750 female 2008 ## 224 5000 male 2008 ## 225 5100 male 2008 ## 226 5200 female 2008 ## 227 4700 female 2008 ## 228 5800 male 2008 ## 229 4600 female 2008 ## 230 6000 male 2008 ## 231 4750 female 2008 ## 232 5950 male 2008 ## 233 4625 female 2009 ## 234 5450 male 2009 ## 235 4725 female 2009 ## 236 5350 male 2009 ## 237 4750 female 2009 ## 238 5600 male 2009 ## 239 4600 female 2009 ## 240 5300 male 2009 ## 241 4875 female 2009 ## 242 5550 male 2009 ## 243 4950 female 2009 ## 244 5400 male 2009 ## 245 4750 female 2009 ## 246 5650 male 2009 ## 247 4850 female 2009 ## 248 5200 male 2009 ## 249 4925 male 2009 ## 250 4875 female 2009 ## 251 4625 female 2009 ## 252 5250 male 2009 ## 253 4850 female 2009 ## 254 5600 male 2009 ## 255 4975 female 2009 ## 256 5500 male 2009 ## 257 4725 <NA> 2009 ## 258 5500 male 2009 ## 259 4700 female 2009 ## 260 5500 male 2009 ## 261 4575 female 2009 ## 262 5500 male 2009 ## 263 5000 female 2009 ## 264 5950 male 2009 ## 265 4650 female 2009 ## 266 5500 male 2009 ## 267 4375 female 2009 ## 268 5850 male 2009 ## 269 4875 <NA> 2009 ## 270 6000 male 2009 ## 271 4925 female 2009 ## 272 NA <NA> 2009 ## 273 4850 female 2009 ## 274 5750 male 2009 ## 275 5200 female 2009 ## 276 5400 male 2009 ## 277 3500 female 2007 ## 278 3900 male 2007 ## 279 3650 male 2007 ## 280 3525 female 2007 ## 281 3725 male 2007 ## 282 3950 female 2007 ## 283 3250 female 2007 ## 284 3750 male 2007 ## 285 4150 female 2007 ## 286 3700 male 2007 ## 287 3800 female 2007 ## 288 3775 male 2007 ## 289 3700 female 2007 ## 290 4050 male 2007 ## 291 3575 female 2007 ## 292 4050 male 2007 ## 293 3300 male 2007 ## 294 3700 female 2007 ## 295 3450 female 2007 ## 296 4400 male 2007 ## 297 3600 female 2007 ## 298 3400 male 2007 ## 299 2900 female 2007 ## 300 3800 male 2007 ## 301 3300 female 2007 ## 302 4150 male 2007 ## 303 3400 female 2008 ## 304 3800 male 2008 ## 305 3700 female 2008 ## 306 4550 male 2008 ## 307 3200 female 2008 ## 308 4300 male 2008 ## 309 3350 female 2008 ## 310 4100 male 2008 ## 311 3600 male 2008 ## 312 3900 female 2008 ## 313 3850 female 2008 ## 314 4800 male 2008 ## 315 2700 female 2008 ## 316 4500 male 2008 ## 317 3950 male 2008 ## 318 3650 female 2008 ## 319 3550 male 2008 ## 320 3500 female 2008 ## 321 3675 female 2009 ## 322 4450 male 2009 ## 323 3400 female 2009 ## 324 4300 male 2009 ## 325 3250 male 2009 ## 326 3675 female 2009 ## 327 3325 female 2009 ## 328 3950 male 2009 ## 329 3600 female 2009 ## 330 4050 male 2009 ## 331 3350 female 2009 ## 332 3450 male 2009 ## 333 3250 female 2009 ## 334 4050 male 2009 ## 335 3800 male 2009 ## 336 3525 female 2009 ## 337 3950 male 2009 ## 338 3650 female 2009 ## 339 3650 female 2009 ## 340 4000 male 2009 ## 341 3400 female 2009 ## 342 3775 male 2009 ## 343 4100 male 2009 ## 344 3775 female 2009 ``` --- # Select clause - aliases ```sql SELECT upper(island) AS island, bill_length_mm * bill_depth_mm AS bill_area_mm2 FROM penguins ``` ``` ## island bill_area_mm2 ## 1 TORGERSEN 731.17 ## 2 TORGERSEN 687.30 ## 3 TORGERSEN 725.40 ## 4 TORGERSEN NA ## 5 TORGERSEN 708.31 ## 6 TORGERSEN 809.58 ## 7 TORGERSEN 692.42 ## 8 TORGERSEN 768.32 ## 9 TORGERSEN 617.21 ## 10 TORGERSEN 848.40 ## 11 TORGERSEN 646.38 ## 12 TORGERSEN 653.94 ## 13 TORGERSEN 723.36 ## 14 TORGERSEN 818.32 ## 15 TORGERSEN 730.06 ## 16 TORGERSEN 651.48 ## 17 TORGERSEN 735.30 ## 18 TORGERSEN 879.75 ## 19 TORGERSEN 632.96 ## 20 TORGERSEN 989.00 ## 21 BISCOE 691.74 ## 22 BISCOE 704.99 ## 23 BISCOE 689.28 ## 24 BISCOE 691.42 ## 25 BISCOE 667.36 ## 26 BISCOE 667.17 ## 27 BISCOE 755.16 ## 28 BISCOE 724.95 ## 29 BISCOE 704.94 ## 30 BISCOE 765.45 ## 31 DREAM 659.65 ## 32 DREAM 673.32 ## 33 DREAM 703.10 ## 34 DREAM 773.01 ## 35 DREAM 618.80 ## 36 DREAM 827.12 ## 37 DREAM 776.00 ## 38 DREAM 780.70 ## 39 DREAM 725.68 ## 40 DREAM 760.18 ## 41 DREAM 657.00 ## 42 DREAM 750.72 ## 43 DREAM 666.00 ## 44 DREAM 868.77 ## 45 DREAM 625.30 ## 46 DREAM 744.48 ## 47 DREAM 780.90 ## 48 DREAM 708.75 ## 49 DREAM 644.40 ## 50 DREAM 896.76 ## 51 BISCOE 700.92 ## 52 BISCOE 757.89 ## 53 BISCOE 626.50 ## 54 BISCOE 819.00 ## 55 BISCOE 624.45 ## 56 BISCOE 770.04 ## 57 BISCOE 682.50 ## 58 BISCOE 763.28 ## 59 BISCOE 605.90 ## 60 BISCOE 718.16 ## 61 BISCOE 603.33 ## 62 BISCOE 871.43 ## 63 BISCOE 639.20 ## 64 BISCOE 748.02 ## 65 BISCOE 622.44 ## 66 BISCOE 748.80 ## 67 BISCOE 575.10 ## 68 BISCOE 785.01 ## 69 TORGERSEN 595.94 ## 70 TORGERSEN 810.92 ## 71 TORGERSEN 636.50 ## 72 TORGERSEN 730.48 ## 73 TORGERSEN 681.12 ## 74 TORGERSEN 865.62 ## 75 TORGERSEN 621.25 ## 76 TORGERSEN 791.80 ## 77 TORGERSEN 687.12 ## 78 TORGERSEN 721.68 ## 79 TORGERSEN 582.82 ## 80 TORGERSEN 804.11 ## 81 TORGERSEN 595.12 ## 82 TORGERSEN 755.04 ## 83 TORGERSEN 689.96 ## 84 TORGERSEN 680.94 ## 85 DREAM 663.94 ## 86 DREAM 838.39 ## 87 DREAM 707.85 ## 88 DREAM 686.34 ## 89 DREAM 735.36 ## 90 DREAM 731.32 ## 91 DREAM 642.60 ## 92 DREAM 743.91 ## 93 DREAM 581.40 ## 94 DREAM 716.76 ## 95 DREAM 626.26 ## 96 DREAM 771.12 ## 97 DREAM 708.66 ## 98 DREAM 745.55 ## 99 DREAM 532.91 ## 100 DREAM 799.20 ## 101 BISCOE 626.50 ## 102 BISCOE 820.00 ## 103 BISCOE 603.20 ## 104 BISCOE 756.00 ## 105 BISCOE 704.94 ## 106 BISCOE 750.33 ## 107 BISCOE 663.92 ## 108 BISCOE 764.00 ## 109 BISCOE 647.70 ## 110 BISCOE 820.80 ## 111 BISCOE 628.65 ## 112 BISCOE 925.68 ## 113 BISCOE 702.69 ## 114 BISCOE 822.90 ## 115 BISCOE 819.72 ## 116 BISCOE 781.41 ## 117 TORGERSEN 656.20 ## 118 TORGERSEN 764.65 ## 119 TORGERSEN 606.90 ## 120 TORGERSEN 764.46 ## 121 TORGERSEN 622.64 ## 122 TORGERSEN 746.46 ## 123 TORGERSEN 683.40 ## 124 TORGERSEN 765.90 ## 125 TORGERSEN 559.68 ## 126 TORGERSEN 771.40 ## 127 TORGERSEN 682.88 ## 128 TORGERSEN 759.45 ## 129 TORGERSEN 666.90 ## 130 TORGERSEN 793.80 ## 131 TORGERSEN 689.15 ## 132 TORGERSEN 827.52 ## 133 DREAM 680.80 ## 134 DREAM 693.75 ## 135 DREAM 670.56 ## 136 DREAM 719.25 ## 137 DREAM 623.00 ## 138 DREAM 808.02 ## 139 DREAM 610.50 ## 140 DREAM 710.63 ## 141 DREAM 687.42 ## 142 DREAM 698.32 ## 143 DREAM 497.55 ## 144 DREAM 691.90 ## 145 DREAM 626.64 ## 146 DREAM 729.30 ## 147 DREAM 729.12 ## 148 DREAM 673.44 ## 149 DREAM 640.80 ## 150 DREAM 684.18 ## 151 DREAM 615.60 ## 152 DREAM 767.75 ## 153 BISCOE 608.52 ## 154 BISCOE 815.00 ## 155 BISCOE 686.67 ## 156 BISCOE 760.00 ## 157 BISCOE 690.20 ## 158 BISCOE 627.75 ## 159 BISCOE 662.84 ## 160 BISCOE 714.51 ## 161 BISCOE 580.22 ## 162 BISCOE 720.72 ## 163 BISCOE 560.33 ## 164 BISCOE 788.90 ## 165 BISCOE 623.35 ## 166 BISCOE 706.64 ## 167 BISCOE 668.68 ## 168 BISCOE 774.01 ## 169 BISCOE 567.00 ## 170 BISCOE 747.84 ## 171 BISCOE 669.90 ## 172 BISCOE 735.37 ## 173 BISCOE 717.86 ## 174 BISCOE 653.95 ## 175 BISCOE 674.25 ## 176 BISCOE 731.54 ## 177 BISCOE 561.99 ## 178 BISCOE 696.11 ## 179 BISCOE 636.35 ## 180 BISCOE 717.00 ## 181 BISCOE 689.26 ## 182 BISCOE 765.00 ## 183 BISCOE 723.69 ## 184 BISCOE 607.76 ## 185 BISCOE 653.95 ## 186 BISCOE 1013.20 ## 187 BISCOE 726.68 ## 188 BISCOE 788.92 ## 189 BISCOE 583.62 ## 190 BISCOE 768.12 ## 191 BISCOE 598.40 ## 192 BISCOE 764.59 ## 193 BISCOE 584.99 ## 194 BISCOE 793.60 ## 195 BISCOE 620.61 ## 196 BISCOE 744.00 ## 197 BISCOE 802.95 ## 198 BISCOE 606.04 ## 199 BISCOE 632.45 ## 200 BISCOE 802.95 ## 201 BISCOE 597.17 ## 202 BISCOE 714.16 ## 203 BISCOE 661.72 ## 204 BISCOE 683.85 ## 205 BISCOE 649.44 ## 206 BISCOE 751.50 ## 207 BISCOE 669.60 ## 208 BISCOE 693.00 ## 209 BISCOE 608.82 ## 210 BISCOE 682.50 ## 211 BISCOE 626.40 ## 212 BISCOE 771.12 ## 213 BISCOE 625.14 ## 214 BISCOE 688.38 ## 215 BISCOE 635.23 ## 216 BISCOE 852.51 ## 217 BISCOE 650.36 ## 218 BISCOE 836.64 ## 219 BISCOE 665.28 ## 220 BISCOE 801.90 ## 221 BISCOE 617.70 ## 222 BISCOE 760.50 ## 223 BISCOE 715.50 ## 224 BISCOE 723.84 ## 225 BISCOE 751.92 ## 226 BISCOE 688.20 ## 227 BISCOE 696.00 ## 228 BISCOE 777.60 ## 229 BISCOE 674.50 ## 230 BISCOE 832.93 ## 231 BISCOE 623.76 ## 232 BISCOE 741.28 ## 233 BISCOE 711.95 ## 234 BISCOE 819.00 ## 235 BISCOE 692.04 ## 236 BISCOE 795.00 ## 237 BISCOE 619.62 ## 238 BISCOE 878.84 ## 239 BISCOE 624.96 ## 240 BISCOE 728.46 ## 241 BISCOE 665.00 ## 242 BISCOE 885.70 ## 243 BISCOE 712.50 ## 244 BISCOE 892.62 ## 245 BISCOE 659.75 ## 246 BISCOE 796.95 ## 247 BISCOE 654.15 ## 248 BISCOE 797.56 ## 249 BISCOE 780.52 ## 250 BISCOE 684.74 ## 251 BISCOE 696.96 ## 252 BISCOE 843.15 ## 253 BISCOE 727.50 ## 254 BISCOE 950.30 ## 255 BISCOE 731.60 ## 256 BISCOE 736.50 ## 257 BISCOE 652.74 ## 258 BISCOE 753.48 ## 259 BISCOE 612.99 ## 260 BISCOE 843.72 ## 261 BISCOE 606.20 ## 262 BISCOE 726.31 ## 263 BISCOE 767.60 ## 264 BISCOE 791.82 ## 265 BISCOE 661.20 ## 266 BISCOE 839.45 ## 267 BISCOE 651.42 ## 268 BISCOE 881.60 ## 269 BISCOE 698.65 ## 270 BISCOE 790.56 ## 271 BISCOE 646.64 ## 272 BISCOE NA ## 273 BISCOE 669.24 ## 274 BISCOE 791.28 ## 275 BISCOE 668.96 ## 276 BISCOE 803.39 ## 277 DREAM 832.35 ## 278 DREAM 975.00 ## 279 DREAM 984.96 ## 280 DREAM 848.98 ## 281 DREAM 1043.46 ## 282 DREAM 804.56 ## 283 DREAM 839.02 ## 284 DREAM 933.66 ## 285 DREAM 869.40 ## 286 DREAM 1020.87 ## 287 DREAM 829.48 ## 288 DREAM 1049.51 ## 289 DREAM 813.10 ## 290 DREAM 941.20 ## 291 DREAM 784.89 ## 292 DREAM 989.80 ## 293 DREAM 1006.00 ## 294 DREAM 1032.40 ## 295 DREAM 863.04 ## 296 DREAM 895.44 ## 297 DREAM 733.52 ## 298 DREAM 848.75 ## 299 DREAM 717.12 ## 300 DREAM 981.64 ## 301 DREAM 835.93 ## 302 DREAM 988.00 ## 303 DREAM 929.20 ## 304 DREAM 940.50 ## 305 DREAM 825.92 ## 306 DREAM 1056.00 ## 307 DREAM 678.94 ## 308 DREAM 1127.36 ## 309 DREAM 709.75 ## 310 DREAM 958.80 ## 311 DREAM 924.42 ## 312 DREAM 798.00 ## 313 DREAM 871.08 ## 314 DREAM 1076.40 ## 315 DREAM 778.54 ## 316 DREAM 1064.65 ## 317 DREAM 955.50 ## 318 DREAM 808.50 ## 319 DREAM 972.19 ## 320 DREAM 773.50 ## 321 DREAM 911.11 ## 322 DREAM 939.80 ## 323 DREAM 896.79 ## 324 DREAM 960.40 ## 325 DREAM 963.05 ## 326 DREAM 861.54 ## 327 DREAM 788.84 ## 328 DREAM 976.60 ## 329 DREAM 790.61 ## 330 DREAM 998.79 ## 331 DREAM 735.25 ## 332 DREAM 981.36 ## 333 DREAM 750.32 ## 334 DREAM 981.07 ## 335 DREAM 943.76 ## 336 DREAM 884.64 ## 337 DREAM 1012.05 ## 338 DREAM 772.20 ## 339 DREAM 776.90 ## 340 DREAM 1104.84 ## 341 DREAM 787.35 ## 342 DREAM 902.72 ## 343 DREAM 965.20 ## 344 DREAM 938.74 ``` --- # Select clause - removing duplicates ```sql SELECT DISTINCT island, species FROM penguins ``` ``` ## island species ## 1 Torgersen Adelie ## 2 Biscoe Adelie ## 3 Dream Adelie ## 4 Biscoe Gentoo ## 5 Dream Chinstrap ``` --- # From clause - subquery ```sql SELECT a.bill_length_mm, a.bill_depth_mm FROM (SELECT species, bill_length_mm, bill_depth_mm FROM penguins WHERE species = 'Adelie' ) AS a ``` ``` ## bill_length_mm bill_depth_mm ## 1 39.1 18.7 ## 2 39.5 17.4 ## 3 40.3 18.0 ## 4 NA NA ## 5 36.7 19.3 ## 6 39.3 20.6 ## 7 38.9 17.8 ## 8 39.2 19.6 ## 9 34.1 18.1 ## 10 42.0 20.2 ## 11 37.8 17.1 ## 12 37.8 17.3 ## 13 41.1 17.6 ## 14 38.6 21.2 ## 15 34.6 21.1 ## 16 36.6 17.8 ## 17 38.7 19.0 ## 18 42.5 20.7 ## 19 34.4 18.4 ## 20 46.0 21.5 ## 21 37.8 18.3 ## 22 37.7 18.7 ## 23 35.9 19.2 ## 24 38.2 18.1 ## 25 38.8 17.2 ## 26 35.3 18.9 ## 27 40.6 18.6 ## 28 40.5 17.9 ## 29 37.9 18.6 ## 30 40.5 18.9 ## 31 39.5 16.7 ## 32 37.2 18.1 ## 33 39.5 17.8 ## 34 40.9 18.9 ## 35 36.4 17.0 ## 36 39.2 21.1 ## 37 38.8 20.0 ## 38 42.2 18.5 ## 39 37.6 19.3 ## 40 39.8 19.1 ## 41 36.5 18.0 ## 42 40.8 18.4 ## 43 36.0 18.5 ## 44 44.1 19.7 ## 45 37.0 16.9 ## 46 39.6 18.8 ## 47 41.1 19.0 ## 48 37.5 18.9 ## 49 36.0 17.9 ## 50 42.3 21.2 ## 51 39.6 17.7 ## 52 40.1 18.9 ## 53 35.0 17.9 ## 54 42.0 19.5 ## 55 34.5 18.1 ## 56 41.4 18.6 ## 57 39.0 17.5 ## 58 40.6 18.8 ## 59 36.5 16.6 ## 60 37.6 19.1 ## 61 35.7 16.9 ## 62 41.3 21.1 ## 63 37.6 17.0 ## 64 41.1 18.2 ## 65 36.4 17.1 ## 66 41.6 18.0 ## 67 35.5 16.2 ## 68 41.1 19.1 ## 69 35.9 16.6 ## 70 41.8 19.4 ## 71 33.5 19.0 ## 72 39.7 18.4 ## 73 39.6 17.2 ## 74 45.8 18.9 ## 75 35.5 17.5 ## 76 42.8 18.5 ## 77 40.9 16.8 ## 78 37.2 19.4 ## 79 36.2 16.1 ## 80 42.1 19.1 ## 81 34.6 17.2 ## 82 42.9 17.6 ## 83 36.7 18.8 ## 84 35.1 19.4 ## 85 37.3 17.8 ## 86 41.3 20.3 ## 87 36.3 19.5 ## 88 36.9 18.6 ## 89 38.3 19.2 ## 90 38.9 18.8 ## 91 35.7 18.0 ## 92 41.1 18.1 ## 93 34.0 17.1 ## 94 39.6 18.1 ## 95 36.2 17.3 ## 96 40.8 18.9 ## 97 38.1 18.6 ## 98 40.3 18.5 ## 99 33.1 16.1 ## 100 43.2 18.5 ## 101 35.0 17.9 ## 102 41.0 20.0 ## 103 37.7 16.0 ## 104 37.8 20.0 ## 105 37.9 18.6 ## 106 39.7 18.9 ## 107 38.6 17.2 ## 108 38.2 20.0 ## 109 38.1 17.0 ## 110 43.2 19.0 ## 111 38.1 16.5 ## 112 45.6 20.3 ## 113 39.7 17.7 ## 114 42.2 19.5 ## 115 39.6 20.7 ## 116 42.7 18.3 ## 117 38.6 17.0 ## 118 37.3 20.5 ## 119 35.7 17.0 ## 120 41.1 18.6 ## 121 36.2 17.2 ## 122 37.7 19.8 ## 123 40.2 17.0 ## 124 41.4 18.5 ## 125 35.2 15.9 ## 126 40.6 19.0 ## 127 38.8 17.6 ## 128 41.5 18.3 ## 129 39.0 17.1 ## 130 44.1 18.0 ## 131 38.5 17.9 ## 132 43.1 19.2 ## 133 36.8 18.5 ## 134 37.5 18.5 ## 135 38.1 17.6 ## 136 41.1 17.5 ## 137 35.6 17.5 ## 138 40.2 20.1 ## 139 37.0 16.5 ## 140 39.7 17.9 ## 141 40.2 17.1 ## 142 40.6 17.2 ## 143 32.1 15.5 ## 144 40.7 17.0 ## 145 37.3 16.8 ## 146 39.0 18.7 ## 147 39.2 18.6 ## 148 36.6 18.4 ## 149 36.0 17.8 ## 150 37.8 18.1 ## 151 36.0 17.1 ## 152 41.5 18.5 ``` --- # Where clause ```sql SELECT species, island, bill_length_mm, bill_length_mm, year FROM penguins WHERE year = 2007 ``` ``` ## species island bill_length_mm bill_length_mm year ## 1 Adelie Torgersen 39.1 39.1 2007 ## 2 Adelie Torgersen 39.5 39.5 2007 ## 3 Adelie Torgersen 40.3 40.3 2007 ## 4 Adelie Torgersen NA NA 2007 ## 5 Adelie Torgersen 36.7 36.7 2007 ## 6 Adelie Torgersen 39.3 39.3 2007 ## 7 Adelie Torgersen 38.9 38.9 2007 ## 8 Adelie Torgersen 39.2 39.2 2007 ## 9 Adelie Torgersen 34.1 34.1 2007 ## 10 Adelie Torgersen 42.0 42.0 2007 ## 11 Adelie Torgersen 37.8 37.8 2007 ## 12 Adelie Torgersen 37.8 37.8 2007 ## 13 Adelie Torgersen 41.1 41.1 2007 ## 14 Adelie Torgersen 38.6 38.6 2007 ## 15 Adelie Torgersen 34.6 34.6 2007 ## 16 Adelie Torgersen 36.6 36.6 2007 ## 17 Adelie Torgersen 38.7 38.7 2007 ## 18 Adelie Torgersen 42.5 42.5 2007 ## 19 Adelie Torgersen 34.4 34.4 2007 ## 20 Adelie Torgersen 46.0 46.0 2007 ## 21 Adelie Biscoe 37.8 37.8 2007 ## 22 Adelie Biscoe 37.7 37.7 2007 ## 23 Adelie Biscoe 35.9 35.9 2007 ## 24 Adelie Biscoe 38.2 38.2 2007 ## 25 Adelie Biscoe 38.8 38.8 2007 ## 26 Adelie Biscoe 35.3 35.3 2007 ## 27 Adelie Biscoe 40.6 40.6 2007 ## 28 Adelie Biscoe 40.5 40.5 2007 ## 29 Adelie Biscoe 37.9 37.9 2007 ## 30 Adelie Biscoe 40.5 40.5 2007 ## 31 Adelie Dream 39.5 39.5 2007 ## 32 Adelie Dream 37.2 37.2 2007 ## 33 Adelie Dream 39.5 39.5 2007 ## 34 Adelie Dream 40.9 40.9 2007 ## 35 Adelie Dream 36.4 36.4 2007 ## 36 Adelie Dream 39.2 39.2 2007 ## 37 Adelie Dream 38.8 38.8 2007 ## 38 Adelie Dream 42.2 42.2 2007 ## 39 Adelie Dream 37.6 37.6 2007 ## 40 Adelie Dream 39.8 39.8 2007 ## 41 Adelie Dream 36.5 36.5 2007 ## 42 Adelie Dream 40.8 40.8 2007 ## 43 Adelie Dream 36.0 36.0 2007 ## 44 Adelie Dream 44.1 44.1 2007 ## 45 Adelie Dream 37.0 37.0 2007 ## 46 Adelie Dream 39.6 39.6 2007 ## 47 Adelie Dream 41.1 41.1 2007 ## 48 Adelie Dream 37.5 37.5 2007 ## 49 Adelie Dream 36.0 36.0 2007 ## 50 Adelie Dream 42.3 42.3 2007 ## 51 Gentoo Biscoe 46.1 46.1 2007 ## 52 Gentoo Biscoe 50.0 50.0 2007 ## 53 Gentoo Biscoe 48.7 48.7 2007 ## 54 Gentoo Biscoe 50.0 50.0 2007 ## 55 Gentoo Biscoe 47.6 47.6 2007 ## 56 Gentoo Biscoe 46.5 46.5 2007 ## 57 Gentoo Biscoe 45.4 45.4 2007 ## 58 Gentoo Biscoe 46.7 46.7 2007 ## 59 Gentoo Biscoe 43.3 43.3 2007 ## 60 Gentoo Biscoe 46.8 46.8 2007 ## 61 Gentoo Biscoe 40.9 40.9 2007 ## 62 Gentoo Biscoe 49.0 49.0 2007 ## 63 Gentoo Biscoe 45.5 45.5 2007 ## 64 Gentoo Biscoe 48.4 48.4 2007 ## 65 Gentoo Biscoe 45.8 45.8 2007 ## 66 Gentoo Biscoe 49.3 49.3 2007 ## 67 Gentoo Biscoe 42.0 42.0 2007 ## 68 Gentoo Biscoe 49.2 49.2 2007 ## 69 Gentoo Biscoe 46.2 46.2 2007 ## 70 Gentoo Biscoe 48.7 48.7 2007 ## 71 Gentoo Biscoe 50.2 50.2 2007 ## 72 Gentoo Biscoe 45.1 45.1 2007 ## 73 Gentoo Biscoe 46.5 46.5 2007 ## 74 Gentoo Biscoe 46.3 46.3 2007 ## 75 Gentoo Biscoe 42.9 42.9 2007 ## 76 Gentoo Biscoe 46.1 46.1 2007 ## 77 Gentoo Biscoe 44.5 44.5 2007 ## 78 Gentoo Biscoe 47.8 47.8 2007 ## 79 Gentoo Biscoe 48.2 48.2 2007 ## 80 Gentoo Biscoe 50.0 50.0 2007 ## 81 Gentoo Biscoe 47.3 47.3 2007 ## 82 Gentoo Biscoe 42.8 42.8 2007 ## 83 Gentoo Biscoe 45.1 45.1 2007 ## 84 Gentoo Biscoe 59.6 59.6 2007 ## 85 Chinstrap Dream 46.5 46.5 2007 ## 86 Chinstrap Dream 50.0 50.0 2007 ## 87 Chinstrap Dream 51.3 51.3 2007 ## 88 Chinstrap Dream 45.4 45.4 2007 ## 89 Chinstrap Dream 52.7 52.7 2007 ## 90 Chinstrap Dream 45.2 45.2 2007 ## 91 Chinstrap Dream 46.1 46.1 2007 ## 92 Chinstrap Dream 51.3 51.3 2007 ## 93 Chinstrap Dream 46.0 46.0 2007 ## 94 Chinstrap Dream 51.3 51.3 2007 ## 95 Chinstrap Dream 46.6 46.6 2007 ## 96 Chinstrap Dream 51.7 51.7 2007 ## 97 Chinstrap Dream 47.0 47.0 2007 ## 98 Chinstrap Dream 52.0 52.0 2007 ## 99 Chinstrap Dream 45.9 45.9 2007 ## 100 Chinstrap Dream 50.5 50.5 2007 ## 101 Chinstrap Dream 50.3 50.3 2007 ## 102 Chinstrap Dream 58.0 58.0 2007 ## 103 Chinstrap Dream 46.4 46.4 2007 ## 104 Chinstrap Dream 49.2 49.2 2007 ## 105 Chinstrap Dream 42.4 42.4 2007 ## 106 Chinstrap Dream 48.5 48.5 2007 ## 107 Chinstrap Dream 43.2 43.2 2007 ## 108 Chinstrap Dream 50.6 50.6 2007 ## 109 Chinstrap Dream 46.7 46.7 2007 ## 110 Chinstrap Dream 52.0 52.0 2007 ``` --- # Where clause ```sql SELECT species, island, bill_length_mm, bill_length_mm, year FROM penguins WHERE year > 2007 ``` ``` ## species island bill_length_mm bill_length_mm year ## 1 Adelie Biscoe 39.6 39.6 2008 ## 2 Adelie Biscoe 40.1 40.1 2008 ## 3 Adelie Biscoe 35.0 35.0 2008 ## 4 Adelie Biscoe 42.0 42.0 2008 ## 5 Adelie Biscoe 34.5 34.5 2008 ## 6 Adelie Biscoe 41.4 41.4 2008 ## 7 Adelie Biscoe 39.0 39.0 2008 ## 8 Adelie Biscoe 40.6 40.6 2008 ## 9 Adelie Biscoe 36.5 36.5 2008 ## 10 Adelie Biscoe 37.6 37.6 2008 ## 11 Adelie Biscoe 35.7 35.7 2008 ## 12 Adelie Biscoe 41.3 41.3 2008 ## 13 Adelie Biscoe 37.6 37.6 2008 ## 14 Adelie Biscoe 41.1 41.1 2008 ## 15 Adelie Biscoe 36.4 36.4 2008 ## 16 Adelie Biscoe 41.6 41.6 2008 ## 17 Adelie Biscoe 35.5 35.5 2008 ## 18 Adelie Biscoe 41.1 41.1 2008 ## 19 Adelie Torgersen 35.9 35.9 2008 ## 20 Adelie Torgersen 41.8 41.8 2008 ## 21 Adelie Torgersen 33.5 33.5 2008 ## 22 Adelie Torgersen 39.7 39.7 2008 ## 23 Adelie Torgersen 39.6 39.6 2008 ## 24 Adelie Torgersen 45.8 45.8 2008 ## 25 Adelie Torgersen 35.5 35.5 2008 ## 26 Adelie Torgersen 42.8 42.8 2008 ## 27 Adelie Torgersen 40.9 40.9 2008 ## 28 Adelie Torgersen 37.2 37.2 2008 ## 29 Adelie Torgersen 36.2 36.2 2008 ## 30 Adelie Torgersen 42.1 42.1 2008 ## 31 Adelie Torgersen 34.6 34.6 2008 ## 32 Adelie Torgersen 42.9 42.9 2008 ## 33 Adelie Torgersen 36.7 36.7 2008 ## 34 Adelie Torgersen 35.1 35.1 2008 ## 35 Adelie Dream 37.3 37.3 2008 ## 36 Adelie Dream 41.3 41.3 2008 ## 37 Adelie Dream 36.3 36.3 2008 ## 38 Adelie Dream 36.9 36.9 2008 ## 39 Adelie Dream 38.3 38.3 2008 ## 40 Adelie Dream 38.9 38.9 2008 ## 41 Adelie Dream 35.7 35.7 2008 ## 42 Adelie Dream 41.1 41.1 2008 ## 43 Adelie Dream 34.0 34.0 2008 ## 44 Adelie Dream 39.6 39.6 2008 ## 45 Adelie Dream 36.2 36.2 2008 ## 46 Adelie Dream 40.8 40.8 2008 ## 47 Adelie Dream 38.1 38.1 2008 ## 48 Adelie Dream 40.3 40.3 2008 ## 49 Adelie Dream 33.1 33.1 2008 ## 50 Adelie Dream 43.2 43.2 2008 ## 51 Adelie Biscoe 35.0 35.0 2009 ## 52 Adelie Biscoe 41.0 41.0 2009 ## 53 Adelie Biscoe 37.7 37.7 2009 ## 54 Adelie Biscoe 37.8 37.8 2009 ## 55 Adelie Biscoe 37.9 37.9 2009 ## 56 Adelie Biscoe 39.7 39.7 2009 ## 57 Adelie Biscoe 38.6 38.6 2009 ## 58 Adelie Biscoe 38.2 38.2 2009 ## 59 Adelie Biscoe 38.1 38.1 2009 ## 60 Adelie Biscoe 43.2 43.2 2009 ## 61 Adelie Biscoe 38.1 38.1 2009 ## 62 Adelie Biscoe 45.6 45.6 2009 ## 63 Adelie Biscoe 39.7 39.7 2009 ## 64 Adelie Biscoe 42.2 42.2 2009 ## 65 Adelie Biscoe 39.6 39.6 2009 ## 66 Adelie Biscoe 42.7 42.7 2009 ## 67 Adelie Torgersen 38.6 38.6 2009 ## 68 Adelie Torgersen 37.3 37.3 2009 ## 69 Adelie Torgersen 35.7 35.7 2009 ## 70 Adelie Torgersen 41.1 41.1 2009 ## 71 Adelie Torgersen 36.2 36.2 2009 ## 72 Adelie Torgersen 37.7 37.7 2009 ## 73 Adelie Torgersen 40.2 40.2 2009 ## 74 Adelie Torgersen 41.4 41.4 2009 ## 75 Adelie Torgersen 35.2 35.2 2009 ## 76 Adelie Torgersen 40.6 40.6 2009 ## 77 Adelie Torgersen 38.8 38.8 2009 ## 78 Adelie Torgersen 41.5 41.5 2009 ## 79 Adelie Torgersen 39.0 39.0 2009 ## 80 Adelie Torgersen 44.1 44.1 2009 ## 81 Adelie Torgersen 38.5 38.5 2009 ## 82 Adelie Torgersen 43.1 43.1 2009 ## 83 Adelie Dream 36.8 36.8 2009 ## 84 Adelie Dream 37.5 37.5 2009 ## 85 Adelie Dream 38.1 38.1 2009 ## 86 Adelie Dream 41.1 41.1 2009 ## 87 Adelie Dream 35.6 35.6 2009 ## 88 Adelie Dream 40.2 40.2 2009 ## 89 Adelie Dream 37.0 37.0 2009 ## 90 Adelie Dream 39.7 39.7 2009 ## 91 Adelie Dream 40.2 40.2 2009 ## 92 Adelie Dream 40.6 40.6 2009 ## 93 Adelie Dream 32.1 32.1 2009 ## 94 Adelie Dream 40.7 40.7 2009 ## 95 Adelie Dream 37.3 37.3 2009 ## 96 Adelie Dream 39.0 39.0 2009 ## 97 Adelie Dream 39.2 39.2 2009 ## 98 Adelie Dream 36.6 36.6 2009 ## 99 Adelie Dream 36.0 36.0 2009 ## 100 Adelie Dream 37.8 37.8 2009 ## 101 Adelie Dream 36.0 36.0 2009 ## 102 Adelie Dream 41.5 41.5 2009 ## 103 Gentoo Biscoe 49.1 49.1 2008 ## 104 Gentoo Biscoe 48.4 48.4 2008 ## 105 Gentoo Biscoe 42.6 42.6 2008 ## 106 Gentoo Biscoe 44.4 44.4 2008 ## 107 Gentoo Biscoe 44.0 44.0 2008 ## 108 Gentoo Biscoe 48.7 48.7 2008 ## 109 Gentoo Biscoe 42.7 42.7 2008 ## 110 Gentoo Biscoe 49.6 49.6 2008 ## 111 Gentoo Biscoe 45.3 45.3 2008 ## 112 Gentoo Biscoe 49.6 49.6 2008 ## 113 Gentoo Biscoe 50.5 50.5 2008 ## 114 Gentoo Biscoe 43.6 43.6 2008 ## 115 Gentoo Biscoe 45.5 45.5 2008 ## 116 Gentoo Biscoe 50.5 50.5 2008 ## 117 Gentoo Biscoe 44.9 44.9 2008 ## 118 Gentoo Biscoe 45.2 45.2 2008 ## 119 Gentoo Biscoe 46.6 46.6 2008 ## 120 Gentoo Biscoe 48.5 48.5 2008 ## 121 Gentoo Biscoe 45.1 45.1 2008 ## 122 Gentoo Biscoe 50.1 50.1 2008 ## 123 Gentoo Biscoe 46.5 46.5 2008 ## 124 Gentoo Biscoe 45.0 45.0 2008 ## 125 Gentoo Biscoe 43.8 43.8 2008 ## 126 Gentoo Biscoe 45.5 45.5 2008 ## 127 Gentoo Biscoe 43.2 43.2 2008 ## 128 Gentoo Biscoe 50.4 50.4 2008 ## 129 Gentoo Biscoe 45.3 45.3 2008 ## 130 Gentoo Biscoe 46.2 46.2 2008 ## 131 Gentoo Biscoe 45.7 45.7 2008 ## 132 Gentoo Biscoe 54.3 54.3 2008 ## 133 Gentoo Biscoe 45.8 45.8 2008 ## 134 Gentoo Biscoe 49.8 49.8 2008 ## 135 Gentoo Biscoe 46.2 46.2 2008 ## 136 Gentoo Biscoe 49.5 49.5 2008 ## 137 Gentoo Biscoe 43.5 43.5 2008 ## 138 Gentoo Biscoe 50.7 50.7 2008 ## 139 Gentoo Biscoe 47.7 47.7 2008 ## 140 Gentoo Biscoe 46.4 46.4 2008 ## 141 Gentoo Biscoe 48.2 48.2 2008 ## 142 Gentoo Biscoe 46.5 46.5 2008 ## 143 Gentoo Biscoe 46.4 46.4 2008 ## 144 Gentoo Biscoe 48.6 48.6 2008 ## 145 Gentoo Biscoe 47.5 47.5 2008 ## 146 Gentoo Biscoe 51.1 51.1 2008 ## 147 Gentoo Biscoe 45.2 45.2 2008 ## 148 Gentoo Biscoe 45.2 45.2 2008 ## 149 Gentoo Biscoe 49.1 49.1 2009 ## 150 Gentoo Biscoe 52.5 52.5 2009 ## 151 Gentoo Biscoe 47.4 47.4 2009 ## 152 Gentoo Biscoe 50.0 50.0 2009 ## 153 Gentoo Biscoe 44.9 44.9 2009 ## 154 Gentoo Biscoe 50.8 50.8 2009 ## 155 Gentoo Biscoe 43.4 43.4 2009 ## 156 Gentoo Biscoe 51.3 51.3 2009 ## 157 Gentoo Biscoe 47.5 47.5 2009 ## 158 Gentoo Biscoe 52.1 52.1 2009 ## 159 Gentoo Biscoe 47.5 47.5 2009 ## 160 Gentoo Biscoe 52.2 52.2 2009 ## 161 Gentoo Biscoe 45.5 45.5 2009 ## 162 Gentoo Biscoe 49.5 49.5 2009 ## 163 Gentoo Biscoe 44.5 44.5 2009 ## 164 Gentoo Biscoe 50.8 50.8 2009 ## 165 Gentoo Biscoe 49.4 49.4 2009 ## 166 Gentoo Biscoe 46.9 46.9 2009 ## 167 Gentoo Biscoe 48.4 48.4 2009 ## 168 Gentoo Biscoe 51.1 51.1 2009 ## 169 Gentoo Biscoe 48.5 48.5 2009 ## 170 Gentoo Biscoe 55.9 55.9 2009 ## 171 Gentoo Biscoe 47.2 47.2 2009 ## 172 Gentoo Biscoe 49.1 49.1 2009 ## 173 Gentoo Biscoe 47.3 47.3 2009 ## 174 Gentoo Biscoe 46.8 46.8 2009 ## 175 Gentoo Biscoe 41.7 41.7 2009 ## 176 Gentoo Biscoe 53.4 53.4 2009 ## 177 Gentoo Biscoe 43.3 43.3 2009 ## 178 Gentoo Biscoe 48.1 48.1 2009 ## 179 Gentoo Biscoe 50.5 50.5 2009 ## 180 Gentoo Biscoe 49.8 49.8 2009 ## 181 Gentoo Biscoe 43.5 43.5 2009 ## 182 Gentoo Biscoe 51.5 51.5 2009 ## 183 Gentoo Biscoe 46.2 46.2 2009 ## 184 Gentoo Biscoe 55.1 55.1 2009 ## 185 Gentoo Biscoe 44.5 44.5 2009 ## 186 Gentoo Biscoe 48.8 48.8 2009 ## 187 Gentoo Biscoe 47.2 47.2 2009 ## 188 Gentoo Biscoe NA NA 2009 ## 189 Gentoo Biscoe 46.8 46.8 2009 ## 190 Gentoo Biscoe 50.4 50.4 2009 ## 191 Gentoo Biscoe 45.2 45.2 2009 ## 192 Gentoo Biscoe 49.9 49.9 2009 ## 193 Chinstrap Dream 50.5 50.5 2008 ## 194 Chinstrap Dream 49.5 49.5 2008 ## 195 Chinstrap Dream 46.4 46.4 2008 ## 196 Chinstrap Dream 52.8 52.8 2008 ## 197 Chinstrap Dream 40.9 40.9 2008 ## 198 Chinstrap Dream 54.2 54.2 2008 ## 199 Chinstrap Dream 42.5 42.5 2008 ## 200 Chinstrap Dream 51.0 51.0 2008 ## 201 Chinstrap Dream 49.7 49.7 2008 ## 202 Chinstrap Dream 47.5 47.5 2008 ## 203 Chinstrap Dream 47.6 47.6 2008 ## 204 Chinstrap Dream 52.0 52.0 2008 ## 205 Chinstrap Dream 46.9 46.9 2008 ## 206 Chinstrap Dream 53.5 53.5 2008 ## 207 Chinstrap Dream 49.0 49.0 2008 ## 208 Chinstrap Dream 46.2 46.2 2008 ## 209 Chinstrap Dream 50.9 50.9 2008 ## 210 Chinstrap Dream 45.5 45.5 2008 ## 211 Chinstrap Dream 50.9 50.9 2009 ## 212 Chinstrap Dream 50.8 50.8 2009 ## 213 Chinstrap Dream 50.1 50.1 2009 ## 214 Chinstrap Dream 49.0 49.0 2009 ## 215 Chinstrap Dream 51.5 51.5 2009 ## 216 Chinstrap Dream 49.8 49.8 2009 ## 217 Chinstrap Dream 48.1 48.1 2009 ## 218 Chinstrap Dream 51.4 51.4 2009 ## 219 Chinstrap Dream 45.7 45.7 2009 ## 220 Chinstrap Dream 50.7 50.7 2009 ## 221 Chinstrap Dream 42.5 42.5 2009 ## 222 Chinstrap Dream 52.2 52.2 2009 ## 223 Chinstrap Dream 45.2 45.2 2009 ## 224 Chinstrap Dream 49.3 49.3 2009 ## 225 Chinstrap Dream 50.2 50.2 2009 ## 226 Chinstrap Dream 45.6 45.6 2009 ## 227 Chinstrap Dream 51.9 51.9 2009 ## 228 Chinstrap Dream 46.8 46.8 2009 ## 229 Chinstrap Dream 45.7 45.7 2009 ## 230 Chinstrap Dream 55.8 55.8 2009 ## 231 Chinstrap Dream 43.5 43.5 2009 ## 232 Chinstrap Dream 49.6 49.6 2009 ## 233 Chinstrap Dream 50.8 50.8 2009 ## 234 Chinstrap Dream 50.2 50.2 2009 ``` --- # Where clause ```sql SELECT species, island, bill_length_mm, bill_length_mm, year FROM penguins WHERE year IN (2007, 2008) ``` ``` ## species island bill_length_mm bill_length_mm year ## 1 Adelie Torgersen 39.1 39.1 2007 ## 2 Adelie Torgersen 39.5 39.5 2007 ## 3 Adelie Torgersen 40.3 40.3 2007 ## 4 Adelie Torgersen NA NA 2007 ## 5 Adelie Torgersen 36.7 36.7 2007 ## 6 Adelie Torgersen 39.3 39.3 2007 ## 7 Adelie Torgersen 38.9 38.9 2007 ## 8 Adelie Torgersen 39.2 39.2 2007 ## 9 Adelie Torgersen 34.1 34.1 2007 ## 10 Adelie Torgersen 42.0 42.0 2007 ## 11 Adelie Torgersen 37.8 37.8 2007 ## 12 Adelie Torgersen 37.8 37.8 2007 ## 13 Adelie Torgersen 41.1 41.1 2007 ## 14 Adelie Torgersen 38.6 38.6 2007 ## 15 Adelie Torgersen 34.6 34.6 2007 ## 16 Adelie Torgersen 36.6 36.6 2007 ## 17 Adelie Torgersen 38.7 38.7 2007 ## 18 Adelie Torgersen 42.5 42.5 2007 ## 19 Adelie Torgersen 34.4 34.4 2007 ## 20 Adelie Torgersen 46.0 46.0 2007 ## 21 Adelie Biscoe 37.8 37.8 2007 ## 22 Adelie Biscoe 37.7 37.7 2007 ## 23 Adelie Biscoe 35.9 35.9 2007 ## 24 Adelie Biscoe 38.2 38.2 2007 ## 25 Adelie Biscoe 38.8 38.8 2007 ## 26 Adelie Biscoe 35.3 35.3 2007 ## 27 Adelie Biscoe 40.6 40.6 2007 ## 28 Adelie Biscoe 40.5 40.5 2007 ## 29 Adelie Biscoe 37.9 37.9 2007 ## 30 Adelie Biscoe 40.5 40.5 2007 ## 31 Adelie Dream 39.5 39.5 2007 ## 32 Adelie Dream 37.2 37.2 2007 ## 33 Adelie Dream 39.5 39.5 2007 ## 34 Adelie Dream 40.9 40.9 2007 ## 35 Adelie Dream 36.4 36.4 2007 ## 36 Adelie Dream 39.2 39.2 2007 ## 37 Adelie Dream 38.8 38.8 2007 ## 38 Adelie Dream 42.2 42.2 2007 ## 39 Adelie Dream 37.6 37.6 2007 ## 40 Adelie Dream 39.8 39.8 2007 ## 41 Adelie Dream 36.5 36.5 2007 ## 42 Adelie Dream 40.8 40.8 2007 ## 43 Adelie Dream 36.0 36.0 2007 ## 44 Adelie Dream 44.1 44.1 2007 ## 45 Adelie Dream 37.0 37.0 2007 ## 46 Adelie Dream 39.6 39.6 2007 ## 47 Adelie Dream 41.1 41.1 2007 ## 48 Adelie Dream 37.5 37.5 2007 ## 49 Adelie Dream 36.0 36.0 2007 ## 50 Adelie Dream 42.3 42.3 2007 ## 51 Adelie Biscoe 39.6 39.6 2008 ## 52 Adelie Biscoe 40.1 40.1 2008 ## 53 Adelie Biscoe 35.0 35.0 2008 ## 54 Adelie Biscoe 42.0 42.0 2008 ## 55 Adelie Biscoe 34.5 34.5 2008 ## 56 Adelie Biscoe 41.4 41.4 2008 ## 57 Adelie Biscoe 39.0 39.0 2008 ## 58 Adelie Biscoe 40.6 40.6 2008 ## 59 Adelie Biscoe 36.5 36.5 2008 ## 60 Adelie Biscoe 37.6 37.6 2008 ## 61 Adelie Biscoe 35.7 35.7 2008 ## 62 Adelie Biscoe 41.3 41.3 2008 ## 63 Adelie Biscoe 37.6 37.6 2008 ## 64 Adelie Biscoe 41.1 41.1 2008 ## 65 Adelie Biscoe 36.4 36.4 2008 ## 66 Adelie Biscoe 41.6 41.6 2008 ## 67 Adelie Biscoe 35.5 35.5 2008 ## 68 Adelie Biscoe 41.1 41.1 2008 ## 69 Adelie Torgersen 35.9 35.9 2008 ## 70 Adelie Torgersen 41.8 41.8 2008 ## 71 Adelie Torgersen 33.5 33.5 2008 ## 72 Adelie Torgersen 39.7 39.7 2008 ## 73 Adelie Torgersen 39.6 39.6 2008 ## 74 Adelie Torgersen 45.8 45.8 2008 ## 75 Adelie Torgersen 35.5 35.5 2008 ## 76 Adelie Torgersen 42.8 42.8 2008 ## 77 Adelie Torgersen 40.9 40.9 2008 ## 78 Adelie Torgersen 37.2 37.2 2008 ## 79 Adelie Torgersen 36.2 36.2 2008 ## 80 Adelie Torgersen 42.1 42.1 2008 ## 81 Adelie Torgersen 34.6 34.6 2008 ## 82 Adelie Torgersen 42.9 42.9 2008 ## 83 Adelie Torgersen 36.7 36.7 2008 ## 84 Adelie Torgersen 35.1 35.1 2008 ## 85 Adelie Dream 37.3 37.3 2008 ## 86 Adelie Dream 41.3 41.3 2008 ## 87 Adelie Dream 36.3 36.3 2008 ## 88 Adelie Dream 36.9 36.9 2008 ## 89 Adelie Dream 38.3 38.3 2008 ## 90 Adelie Dream 38.9 38.9 2008 ## 91 Adelie Dream 35.7 35.7 2008 ## 92 Adelie Dream 41.1 41.1 2008 ## 93 Adelie Dream 34.0 34.0 2008 ## 94 Adelie Dream 39.6 39.6 2008 ## 95 Adelie Dream 36.2 36.2 2008 ## 96 Adelie Dream 40.8 40.8 2008 ## 97 Adelie Dream 38.1 38.1 2008 ## 98 Adelie Dream 40.3 40.3 2008 ## 99 Adelie Dream 33.1 33.1 2008 ## 100 Adelie Dream 43.2 43.2 2008 ## 101 Gentoo Biscoe 46.1 46.1 2007 ## 102 Gentoo Biscoe 50.0 50.0 2007 ## 103 Gentoo Biscoe 48.7 48.7 2007 ## 104 Gentoo Biscoe 50.0 50.0 2007 ## 105 Gentoo Biscoe 47.6 47.6 2007 ## 106 Gentoo Biscoe 46.5 46.5 2007 ## 107 Gentoo Biscoe 45.4 45.4 2007 ## 108 Gentoo Biscoe 46.7 46.7 2007 ## 109 Gentoo Biscoe 43.3 43.3 2007 ## 110 Gentoo Biscoe 46.8 46.8 2007 ## 111 Gentoo Biscoe 40.9 40.9 2007 ## 112 Gentoo Biscoe 49.0 49.0 2007 ## 113 Gentoo Biscoe 45.5 45.5 2007 ## 114 Gentoo Biscoe 48.4 48.4 2007 ## 115 Gentoo Biscoe 45.8 45.8 2007 ## 116 Gentoo Biscoe 49.3 49.3 2007 ## 117 Gentoo Biscoe 42.0 42.0 2007 ## 118 Gentoo Biscoe 49.2 49.2 2007 ## 119 Gentoo Biscoe 46.2 46.2 2007 ## 120 Gentoo Biscoe 48.7 48.7 2007 ## 121 Gentoo Biscoe 50.2 50.2 2007 ## 122 Gentoo Biscoe 45.1 45.1 2007 ## 123 Gentoo Biscoe 46.5 46.5 2007 ## 124 Gentoo Biscoe 46.3 46.3 2007 ## 125 Gentoo Biscoe 42.9 42.9 2007 ## 126 Gentoo Biscoe 46.1 46.1 2007 ## 127 Gentoo Biscoe 44.5 44.5 2007 ## 128 Gentoo Biscoe 47.8 47.8 2007 ## 129 Gentoo Biscoe 48.2 48.2 2007 ## 130 Gentoo Biscoe 50.0 50.0 2007 ## 131 Gentoo Biscoe 47.3 47.3 2007 ## 132 Gentoo Biscoe 42.8 42.8 2007 ## 133 Gentoo Biscoe 45.1 45.1 2007 ## 134 Gentoo Biscoe 59.6 59.6 2007 ## 135 Gentoo Biscoe 49.1 49.1 2008 ## 136 Gentoo Biscoe 48.4 48.4 2008 ## 137 Gentoo Biscoe 42.6 42.6 2008 ## 138 Gentoo Biscoe 44.4 44.4 2008 ## 139 Gentoo Biscoe 44.0 44.0 2008 ## 140 Gentoo Biscoe 48.7 48.7 2008 ## 141 Gentoo Biscoe 42.7 42.7 2008 ## 142 Gentoo Biscoe 49.6 49.6 2008 ## 143 Gentoo Biscoe 45.3 45.3 2008 ## 144 Gentoo Biscoe 49.6 49.6 2008 ## 145 Gentoo Biscoe 50.5 50.5 2008 ## 146 Gentoo Biscoe 43.6 43.6 2008 ## 147 Gentoo Biscoe 45.5 45.5 2008 ## 148 Gentoo Biscoe 50.5 50.5 2008 ## 149 Gentoo Biscoe 44.9 44.9 2008 ## 150 Gentoo Biscoe 45.2 45.2 2008 ## 151 Gentoo Biscoe 46.6 46.6 2008 ## 152 Gentoo Biscoe 48.5 48.5 2008 ## 153 Gentoo Biscoe 45.1 45.1 2008 ## 154 Gentoo Biscoe 50.1 50.1 2008 ## 155 Gentoo Biscoe 46.5 46.5 2008 ## 156 Gentoo Biscoe 45.0 45.0 2008 ## 157 Gentoo Biscoe 43.8 43.8 2008 ## 158 Gentoo Biscoe 45.5 45.5 2008 ## 159 Gentoo Biscoe 43.2 43.2 2008 ## 160 Gentoo Biscoe 50.4 50.4 2008 ## 161 Gentoo Biscoe 45.3 45.3 2008 ## 162 Gentoo Biscoe 46.2 46.2 2008 ## 163 Gentoo Biscoe 45.7 45.7 2008 ## 164 Gentoo Biscoe 54.3 54.3 2008 ## 165 Gentoo Biscoe 45.8 45.8 2008 ## 166 Gentoo Biscoe 49.8 49.8 2008 ## 167 Gentoo Biscoe 46.2 46.2 2008 ## 168 Gentoo Biscoe 49.5 49.5 2008 ## 169 Gentoo Biscoe 43.5 43.5 2008 ## 170 Gentoo Biscoe 50.7 50.7 2008 ## 171 Gentoo Biscoe 47.7 47.7 2008 ## 172 Gentoo Biscoe 46.4 46.4 2008 ## 173 Gentoo Biscoe 48.2 48.2 2008 ## 174 Gentoo Biscoe 46.5 46.5 2008 ## 175 Gentoo Biscoe 46.4 46.4 2008 ## 176 Gentoo Biscoe 48.6 48.6 2008 ## 177 Gentoo Biscoe 47.5 47.5 2008 ## 178 Gentoo Biscoe 51.1 51.1 2008 ## 179 Gentoo Biscoe 45.2 45.2 2008 ## 180 Gentoo Biscoe 45.2 45.2 2008 ## 181 Chinstrap Dream 46.5 46.5 2007 ## 182 Chinstrap Dream 50.0 50.0 2007 ## 183 Chinstrap Dream 51.3 51.3 2007 ## 184 Chinstrap Dream 45.4 45.4 2007 ## 185 Chinstrap Dream 52.7 52.7 2007 ## 186 Chinstrap Dream 45.2 45.2 2007 ## 187 Chinstrap Dream 46.1 46.1 2007 ## 188 Chinstrap Dream 51.3 51.3 2007 ## 189 Chinstrap Dream 46.0 46.0 2007 ## 190 Chinstrap Dream 51.3 51.3 2007 ## 191 Chinstrap Dream 46.6 46.6 2007 ## 192 Chinstrap Dream 51.7 51.7 2007 ## 193 Chinstrap Dream 47.0 47.0 2007 ## 194 Chinstrap Dream 52.0 52.0 2007 ## 195 Chinstrap Dream 45.9 45.9 2007 ## 196 Chinstrap Dream 50.5 50.5 2007 ## 197 Chinstrap Dream 50.3 50.3 2007 ## 198 Chinstrap Dream 58.0 58.0 2007 ## 199 Chinstrap Dream 46.4 46.4 2007 ## 200 Chinstrap Dream 49.2 49.2 2007 ## 201 Chinstrap Dream 42.4 42.4 2007 ## 202 Chinstrap Dream 48.5 48.5 2007 ## 203 Chinstrap Dream 43.2 43.2 2007 ## 204 Chinstrap Dream 50.6 50.6 2007 ## 205 Chinstrap Dream 46.7 46.7 2007 ## 206 Chinstrap Dream 52.0 52.0 2007 ## 207 Chinstrap Dream 50.5 50.5 2008 ## 208 Chinstrap Dream 49.5 49.5 2008 ## 209 Chinstrap Dream 46.4 46.4 2008 ## 210 Chinstrap Dream 52.8 52.8 2008 ## 211 Chinstrap Dream 40.9 40.9 2008 ## 212 Chinstrap Dream 54.2 54.2 2008 ## 213 Chinstrap Dream 42.5 42.5 2008 ## 214 Chinstrap Dream 51.0 51.0 2008 ## 215 Chinstrap Dream 49.7 49.7 2008 ## 216 Chinstrap Dream 47.5 47.5 2008 ## 217 Chinstrap Dream 47.6 47.6 2008 ## 218 Chinstrap Dream 52.0 52.0 2008 ## 219 Chinstrap Dream 46.9 46.9 2008 ## 220 Chinstrap Dream 53.5 53.5 2008 ## 221 Chinstrap Dream 49.0 49.0 2008 ## 222 Chinstrap Dream 46.2 46.2 2008 ## 223 Chinstrap Dream 50.9 50.9 2008 ## 224 Chinstrap Dream 45.5 45.5 2008 ``` --- # Where clause ```sql SELECT species, island, bill_length_mm, bill_length_mm, year FROM penguins WHERE year = 2007 AND species = 'Gentoo' ``` ``` ## species island bill_length_mm bill_length_mm year ## 1 Gentoo Biscoe 46.1 46.1 2007 ## 2 Gentoo Biscoe 50.0 50.0 2007 ## 3 Gentoo Biscoe 48.7 48.7 2007 ## 4 Gentoo Biscoe 50.0 50.0 2007 ## 5 Gentoo Biscoe 47.6 47.6 2007 ## 6 Gentoo Biscoe 46.5 46.5 2007 ## 7 Gentoo Biscoe 45.4 45.4 2007 ## 8 Gentoo Biscoe 46.7 46.7 2007 ## 9 Gentoo Biscoe 43.3 43.3 2007 ## 10 Gentoo Biscoe 46.8 46.8 2007 ## 11 Gentoo Biscoe 40.9 40.9 2007 ## 12 Gentoo Biscoe 49.0 49.0 2007 ## 13 Gentoo Biscoe 45.5 45.5 2007 ## 14 Gentoo Biscoe 48.4 48.4 2007 ## 15 Gentoo Biscoe 45.8 45.8 2007 ## 16 Gentoo Biscoe 49.3 49.3 2007 ## 17 Gentoo Biscoe 42.0 42.0 2007 ## 18 Gentoo Biscoe 49.2 49.2 2007 ## 19 Gentoo Biscoe 46.2 46.2 2007 ## 20 Gentoo Biscoe 48.7 48.7 2007 ## 21 Gentoo Biscoe 50.2 50.2 2007 ## 22 Gentoo Biscoe 45.1 45.1 2007 ## 23 Gentoo Biscoe 46.5 46.5 2007 ## 24 Gentoo Biscoe 46.3 46.3 2007 ## 25 Gentoo Biscoe 42.9 42.9 2007 ## 26 Gentoo Biscoe 46.1 46.1 2007 ## 27 Gentoo Biscoe 44.5 44.5 2007 ## 28 Gentoo Biscoe 47.8 47.8 2007 ## 29 Gentoo Biscoe 48.2 48.2 2007 ## 30 Gentoo Biscoe 50.0 50.0 2007 ## 31 Gentoo Biscoe 47.3 47.3 2007 ## 32 Gentoo Biscoe 42.8 42.8 2007 ## 33 Gentoo Biscoe 45.1 45.1 2007 ## 34 Gentoo Biscoe 59.6 59.6 2007 ``` --- # Where clause ```sql SELECT species, island, bill_length_mm, bill_length_mm, year FROM penguins WHERE year = 2007 OR species = 'Gentoo' ``` ``` ## species island bill_length_mm bill_length_mm year ## 1 Adelie Torgersen 39.1 39.1 2007 ## 2 Adelie Torgersen 39.5 39.5 2007 ## 3 Adelie Torgersen 40.3 40.3 2007 ## 4 Adelie Torgersen NA NA 2007 ## 5 Adelie Torgersen 36.7 36.7 2007 ## 6 Adelie Torgersen 39.3 39.3 2007 ## 7 Adelie Torgersen 38.9 38.9 2007 ## 8 Adelie Torgersen 39.2 39.2 2007 ## 9 Adelie Torgersen 34.1 34.1 2007 ## 10 Adelie Torgersen 42.0 42.0 2007 ## 11 Adelie Torgersen 37.8 37.8 2007 ## 12 Adelie Torgersen 37.8 37.8 2007 ## 13 Adelie Torgersen 41.1 41.1 2007 ## 14 Adelie Torgersen 38.6 38.6 2007 ## 15 Adelie Torgersen 34.6 34.6 2007 ## 16 Adelie Torgersen 36.6 36.6 2007 ## 17 Adelie Torgersen 38.7 38.7 2007 ## 18 Adelie Torgersen 42.5 42.5 2007 ## 19 Adelie Torgersen 34.4 34.4 2007 ## 20 Adelie Torgersen 46.0 46.0 2007 ## 21 Adelie Biscoe 37.8 37.8 2007 ## 22 Adelie Biscoe 37.7 37.7 2007 ## 23 Adelie Biscoe 35.9 35.9 2007 ## 24 Adelie Biscoe 38.2 38.2 2007 ## 25 Adelie Biscoe 38.8 38.8 2007 ## 26 Adelie Biscoe 35.3 35.3 2007 ## 27 Adelie Biscoe 40.6 40.6 2007 ## 28 Adelie Biscoe 40.5 40.5 2007 ## 29 Adelie Biscoe 37.9 37.9 2007 ## 30 Adelie Biscoe 40.5 40.5 2007 ## 31 Adelie Dream 39.5 39.5 2007 ## 32 Adelie Dream 37.2 37.2 2007 ## 33 Adelie Dream 39.5 39.5 2007 ## 34 Adelie Dream 40.9 40.9 2007 ## 35 Adelie Dream 36.4 36.4 2007 ## 36 Adelie Dream 39.2 39.2 2007 ## 37 Adelie Dream 38.8 38.8 2007 ## 38 Adelie Dream 42.2 42.2 2007 ## 39 Adelie Dream 37.6 37.6 2007 ## 40 Adelie Dream 39.8 39.8 2007 ## 41 Adelie Dream 36.5 36.5 2007 ## 42 Adelie Dream 40.8 40.8 2007 ## 43 Adelie Dream 36.0 36.0 2007 ## 44 Adelie Dream 44.1 44.1 2007 ## 45 Adelie Dream 37.0 37.0 2007 ## 46 Adelie Dream 39.6 39.6 2007 ## 47 Adelie Dream 41.1 41.1 2007 ## 48 Adelie Dream 37.5 37.5 2007 ## 49 Adelie Dream 36.0 36.0 2007 ## 50 Adelie Dream 42.3 42.3 2007 ## 51 Gentoo Biscoe 46.1 46.1 2007 ## 52 Gentoo Biscoe 50.0 50.0 2007 ## 53 Gentoo Biscoe 48.7 48.7 2007 ## 54 Gentoo Biscoe 50.0 50.0 2007 ## 55 Gentoo Biscoe 47.6 47.6 2007 ## 56 Gentoo Biscoe 46.5 46.5 2007 ## 57 Gentoo Biscoe 45.4 45.4 2007 ## 58 Gentoo Biscoe 46.7 46.7 2007 ## 59 Gentoo Biscoe 43.3 43.3 2007 ## 60 Gentoo Biscoe 46.8 46.8 2007 ## 61 Gentoo Biscoe 40.9 40.9 2007 ## 62 Gentoo Biscoe 49.0 49.0 2007 ## 63 Gentoo Biscoe 45.5 45.5 2007 ## 64 Gentoo Biscoe 48.4 48.4 2007 ## 65 Gentoo Biscoe 45.8 45.8 2007 ## 66 Gentoo Biscoe 49.3 49.3 2007 ## 67 Gentoo Biscoe 42.0 42.0 2007 ## 68 Gentoo Biscoe 49.2 49.2 2007 ## 69 Gentoo Biscoe 46.2 46.2 2007 ## 70 Gentoo Biscoe 48.7 48.7 2007 ## 71 Gentoo Biscoe 50.2 50.2 2007 ## 72 Gentoo Biscoe 45.1 45.1 2007 ## 73 Gentoo Biscoe 46.5 46.5 2007 ## 74 Gentoo Biscoe 46.3 46.3 2007 ## 75 Gentoo Biscoe 42.9 42.9 2007 ## 76 Gentoo Biscoe 46.1 46.1 2007 ## 77 Gentoo Biscoe 44.5 44.5 2007 ## 78 Gentoo Biscoe 47.8 47.8 2007 ## 79 Gentoo Biscoe 48.2 48.2 2007 ## 80 Gentoo Biscoe 50.0 50.0 2007 ## 81 Gentoo Biscoe 47.3 47.3 2007 ## 82 Gentoo Biscoe 42.8 42.8 2007 ## 83 Gentoo Biscoe 45.1 45.1 2007 ## 84 Gentoo Biscoe 59.6 59.6 2007 ## 85 Gentoo Biscoe 49.1 49.1 2008 ## 86 Gentoo Biscoe 48.4 48.4 2008 ## 87 Gentoo Biscoe 42.6 42.6 2008 ## 88 Gentoo Biscoe 44.4 44.4 2008 ## 89 Gentoo Biscoe 44.0 44.0 2008 ## 90 Gentoo Biscoe 48.7 48.7 2008 ## 91 Gentoo Biscoe 42.7 42.7 2008 ## 92 Gentoo Biscoe 49.6 49.6 2008 ## 93 Gentoo Biscoe 45.3 45.3 2008 ## 94 Gentoo Biscoe 49.6 49.6 2008 ## 95 Gentoo Biscoe 50.5 50.5 2008 ## 96 Gentoo Biscoe 43.6 43.6 2008 ## 97 Gentoo Biscoe 45.5 45.5 2008 ## 98 Gentoo Biscoe 50.5 50.5 2008 ## 99 Gentoo Biscoe 44.9 44.9 2008 ## 100 Gentoo Biscoe 45.2 45.2 2008 ## 101 Gentoo Biscoe 46.6 46.6 2008 ## 102 Gentoo Biscoe 48.5 48.5 2008 ## 103 Gentoo Biscoe 45.1 45.1 2008 ## 104 Gentoo Biscoe 50.1 50.1 2008 ## 105 Gentoo Biscoe 46.5 46.5 2008 ## 106 Gentoo Biscoe 45.0 45.0 2008 ## 107 Gentoo Biscoe 43.8 43.8 2008 ## 108 Gentoo Biscoe 45.5 45.5 2008 ## 109 Gentoo Biscoe 43.2 43.2 2008 ## 110 Gentoo Biscoe 50.4 50.4 2008 ## 111 Gentoo Biscoe 45.3 45.3 2008 ## 112 Gentoo Biscoe 46.2 46.2 2008 ## 113 Gentoo Biscoe 45.7 45.7 2008 ## 114 Gentoo Biscoe 54.3 54.3 2008 ## 115 Gentoo Biscoe 45.8 45.8 2008 ## 116 Gentoo Biscoe 49.8 49.8 2008 ## 117 Gentoo Biscoe 46.2 46.2 2008 ## 118 Gentoo Biscoe 49.5 49.5 2008 ## 119 Gentoo Biscoe 43.5 43.5 2008 ## 120 Gentoo Biscoe 50.7 50.7 2008 ## 121 Gentoo Biscoe 47.7 47.7 2008 ## 122 Gentoo Biscoe 46.4 46.4 2008 ## 123 Gentoo Biscoe 48.2 48.2 2008 ## 124 Gentoo Biscoe 46.5 46.5 2008 ## 125 Gentoo Biscoe 46.4 46.4 2008 ## 126 Gentoo Biscoe 48.6 48.6 2008 ## 127 Gentoo Biscoe 47.5 47.5 2008 ## 128 Gentoo Biscoe 51.1 51.1 2008 ## 129 Gentoo Biscoe 45.2 45.2 2008 ## 130 Gentoo Biscoe 45.2 45.2 2008 ## 131 Gentoo Biscoe 49.1 49.1 2009 ## 132 Gentoo Biscoe 52.5 52.5 2009 ## 133 Gentoo Biscoe 47.4 47.4 2009 ## 134 Gentoo Biscoe 50.0 50.0 2009 ## 135 Gentoo Biscoe 44.9 44.9 2009 ## 136 Gentoo Biscoe 50.8 50.8 2009 ## 137 Gentoo Biscoe 43.4 43.4 2009 ## 138 Gentoo Biscoe 51.3 51.3 2009 ## 139 Gentoo Biscoe 47.5 47.5 2009 ## 140 Gentoo Biscoe 52.1 52.1 2009 ## 141 Gentoo Biscoe 47.5 47.5 2009 ## 142 Gentoo Biscoe 52.2 52.2 2009 ## 143 Gentoo Biscoe 45.5 45.5 2009 ## 144 Gentoo Biscoe 49.5 49.5 2009 ## 145 Gentoo Biscoe 44.5 44.5 2009 ## 146 Gentoo Biscoe 50.8 50.8 2009 ## 147 Gentoo Biscoe 49.4 49.4 2009 ## 148 Gentoo Biscoe 46.9 46.9 2009 ## 149 Gentoo Biscoe 48.4 48.4 2009 ## 150 Gentoo Biscoe 51.1 51.1 2009 ## 151 Gentoo Biscoe 48.5 48.5 2009 ## 152 Gentoo Biscoe 55.9 55.9 2009 ## 153 Gentoo Biscoe 47.2 47.2 2009 ## 154 Gentoo Biscoe 49.1 49.1 2009 ## 155 Gentoo Biscoe 47.3 47.3 2009 ## 156 Gentoo Biscoe 46.8 46.8 2009 ## 157 Gentoo Biscoe 41.7 41.7 2009 ## 158 Gentoo Biscoe 53.4 53.4 2009 ## 159 Gentoo Biscoe 43.3 43.3 2009 ## 160 Gentoo Biscoe 48.1 48.1 2009 ## 161 Gentoo Biscoe 50.5 50.5 2009 ## 162 Gentoo Biscoe 49.8 49.8 2009 ## 163 Gentoo Biscoe 43.5 43.5 2009 ## 164 Gentoo Biscoe 51.5 51.5 2009 ## 165 Gentoo Biscoe 46.2 46.2 2009 ## 166 Gentoo Biscoe 55.1 55.1 2009 ## 167 Gentoo Biscoe 44.5 44.5 2009 ## 168 Gentoo Biscoe 48.8 48.8 2009 ## 169 Gentoo Biscoe 47.2 47.2 2009 ## 170 Gentoo Biscoe NA NA 2009 ## 171 Gentoo Biscoe 46.8 46.8 2009 ## 172 Gentoo Biscoe 50.4 50.4 2009 ## 173 Gentoo Biscoe 45.2 45.2 2009 ## 174 Gentoo Biscoe 49.9 49.9 2009 ## 175 Chinstrap Dream 46.5 46.5 2007 ## 176 Chinstrap Dream 50.0 50.0 2007 ## 177 Chinstrap Dream 51.3 51.3 2007 ## 178 Chinstrap Dream 45.4 45.4 2007 ## 179 Chinstrap Dream 52.7 52.7 2007 ## 180 Chinstrap Dream 45.2 45.2 2007 ## 181 Chinstrap Dream 46.1 46.1 2007 ## 182 Chinstrap Dream 51.3 51.3 2007 ## 183 Chinstrap Dream 46.0 46.0 2007 ## 184 Chinstrap Dream 51.3 51.3 2007 ## 185 Chinstrap Dream 46.6 46.6 2007 ## 186 Chinstrap Dream 51.7 51.7 2007 ## 187 Chinstrap Dream 47.0 47.0 2007 ## 188 Chinstrap Dream 52.0 52.0 2007 ## 189 Chinstrap Dream 45.9 45.9 2007 ## 190 Chinstrap Dream 50.5 50.5 2007 ## 191 Chinstrap Dream 50.3 50.3 2007 ## 192 Chinstrap Dream 58.0 58.0 2007 ## 193 Chinstrap Dream 46.4 46.4 2007 ## 194 Chinstrap Dream 49.2 49.2 2007 ## 195 Chinstrap Dream 42.4 42.4 2007 ## 196 Chinstrap Dream 48.5 48.5 2007 ## 197 Chinstrap Dream 43.2 43.2 2007 ## 198 Chinstrap Dream 50.6 50.6 2007 ## 199 Chinstrap Dream 46.7 46.7 2007 ## 200 Chinstrap Dream 52.0 52.0 2007 ``` --- # Order by clause ```sql SELECT species, island, bill_length_mm, bill_depth_mm FROM penguins ORDER BY bill_length_mm ``` ``` ## species island bill_length_mm bill_depth_mm ## 1 Adelie Torgersen NA NA ## 2 Gentoo Biscoe NA NA ## 3 Adelie Dream 32.1 15.5 ## 4 Adelie Dream 33.1 16.1 ## 5 Adelie Torgersen 33.5 19.0 ## 6 Adelie Dream 34.0 17.1 ## 7 Adelie Torgersen 34.1 18.1 ## 8 Adelie Torgersen 34.4 18.4 ## 9 Adelie Biscoe 34.5 18.1 ## 10 Adelie Torgersen 34.6 21.1 ## 11 Adelie Torgersen 34.6 17.2 ## 12 Adelie Biscoe 35.0 17.9 ## 13 Adelie Biscoe 35.0 17.9 ## 14 Adelie Torgersen 35.1 19.4 ## 15 Adelie Torgersen 35.2 15.9 ## 16 Adelie Biscoe 35.3 18.9 ## 17 Adelie Biscoe 35.5 16.2 ## 18 Adelie Torgersen 35.5 17.5 ## 19 Adelie Dream 35.6 17.5 ## 20 Adelie Biscoe 35.7 16.9 ## 21 Adelie Dream 35.7 18.0 ## 22 Adelie Torgersen 35.7 17.0 ## 23 Adelie Biscoe 35.9 19.2 ## 24 Adelie Torgersen 35.9 16.6 ## 25 Adelie Dream 36.0 18.5 ## 26 Adelie Dream 36.0 17.9 ## 27 Adelie Dream 36.0 17.8 ## 28 Adelie Dream 36.0 17.1 ## 29 Adelie Torgersen 36.2 16.1 ## 30 Adelie Dream 36.2 17.3 ## 31 Adelie Torgersen 36.2 17.2 ## 32 Adelie Dream 36.3 19.5 ## 33 Adelie Dream 36.4 17.0 ## 34 Adelie Biscoe 36.4 17.1 ## 35 Adelie Dream 36.5 18.0 ## 36 Adelie Biscoe 36.5 16.6 ## 37 Adelie Torgersen 36.6 17.8 ## 38 Adelie Dream 36.6 18.4 ## 39 Adelie Torgersen 36.7 19.3 ## 40 Adelie Torgersen 36.7 18.8 ## 41 Adelie Dream 36.8 18.5 ## 42 Adelie Dream 36.9 18.6 ## 43 Adelie Dream 37.0 16.9 ## 44 Adelie Dream 37.0 16.5 ## 45 Adelie Dream 37.2 18.1 ## 46 Adelie Torgersen 37.2 19.4 ## 47 Adelie Dream 37.3 17.8 ## 48 Adelie Torgersen 37.3 20.5 ## 49 Adelie Dream 37.3 16.8 ## 50 Adelie Dream 37.5 18.9 ## 51 Adelie Dream 37.5 18.5 ## 52 Adelie Dream 37.6 19.3 ## 53 Adelie Biscoe 37.6 19.1 ## 54 Adelie Biscoe 37.6 17.0 ## 55 Adelie Biscoe 37.7 18.7 ## 56 Adelie Biscoe 37.7 16.0 ## 57 Adelie Torgersen 37.7 19.8 ## 58 Adelie Torgersen 37.8 17.1 ## 59 Adelie Torgersen 37.8 17.3 ## 60 Adelie Biscoe 37.8 18.3 ## 61 Adelie Biscoe 37.8 20.0 ## 62 Adelie Dream 37.8 18.1 ## 63 Adelie Biscoe 37.9 18.6 ## 64 Adelie Biscoe 37.9 18.6 ## 65 Adelie Dream 38.1 18.6 ## 66 Adelie Biscoe 38.1 17.0 ## 67 Adelie Biscoe 38.1 16.5 ## 68 Adelie Dream 38.1 17.6 ## 69 Adelie Biscoe 38.2 18.1 ## 70 Adelie Biscoe 38.2 20.0 ## 71 Adelie Dream 38.3 19.2 ## 72 Adelie Torgersen 38.5 17.9 ## 73 Adelie Torgersen 38.6 21.2 ## 74 Adelie Biscoe 38.6 17.2 ## 75 Adelie Torgersen 38.6 17.0 ## 76 Adelie Torgersen 38.7 19.0 ## 77 Adelie Biscoe 38.8 17.2 ## 78 Adelie Dream 38.8 20.0 ## 79 Adelie Torgersen 38.8 17.6 ## 80 Adelie Torgersen 38.9 17.8 ## 81 Adelie Dream 38.9 18.8 ## 82 Adelie Biscoe 39.0 17.5 ## 83 Adelie Torgersen 39.0 17.1 ## 84 Adelie Dream 39.0 18.7 ## 85 Adelie Torgersen 39.1 18.7 ## 86 Adelie Torgersen 39.2 19.6 ## 87 Adelie Dream 39.2 21.1 ## 88 Adelie Dream 39.2 18.6 ## 89 Adelie Torgersen 39.3 20.6 ## 90 Adelie Torgersen 39.5 17.4 ## 91 Adelie Dream 39.5 16.7 ## 92 Adelie Dream 39.5 17.8 ## 93 Adelie Dream 39.6 18.8 ## 94 Adelie Biscoe 39.6 17.7 ## 95 Adelie Torgersen 39.6 17.2 ## 96 Adelie Dream 39.6 18.1 ## 97 Adelie Biscoe 39.6 20.7 ## 98 Adelie Torgersen 39.7 18.4 ## 99 Adelie Biscoe 39.7 18.9 ## 100 Adelie Biscoe 39.7 17.7 ## 101 Adelie Dream 39.7 17.9 ## 102 Adelie Dream 39.8 19.1 ## 103 Adelie Biscoe 40.1 18.9 ## 104 Adelie Torgersen 40.2 17.0 ## 105 Adelie Dream 40.2 20.1 ## 106 Adelie Dream 40.2 17.1 ## 107 Adelie Torgersen 40.3 18.0 ## 108 Adelie Dream 40.3 18.5 ## 109 Adelie Biscoe 40.5 17.9 ## 110 Adelie Biscoe 40.5 18.9 ## 111 Adelie Biscoe 40.6 18.6 ## 112 Adelie Biscoe 40.6 18.8 ## 113 Adelie Torgersen 40.6 19.0 ## 114 Adelie Dream 40.6 17.2 ## 115 Adelie Dream 40.7 17.0 ## 116 Adelie Dream 40.8 18.4 ## 117 Adelie Dream 40.8 18.9 ## 118 Adelie Dream 40.9 18.9 ## 119 Adelie Torgersen 40.9 16.8 ## 120 Gentoo Biscoe 40.9 13.7 ## 121 Chinstrap Dream 40.9 16.6 ## 122 Adelie Biscoe 41.0 20.0 ## 123 Adelie Torgersen 41.1 17.6 ## 124 Adelie Dream 41.1 19.0 ## 125 Adelie Biscoe 41.1 18.2 ## 126 Adelie Biscoe 41.1 19.1 ## 127 Adelie Dream 41.1 18.1 ## 128 Adelie Torgersen 41.1 18.6 ## 129 Adelie Dream 41.1 17.5 ## 130 Adelie Biscoe 41.3 21.1 ## 131 Adelie Dream 41.3 20.3 ## 132 Adelie Biscoe 41.4 18.6 ## 133 Adelie Torgersen 41.4 18.5 ## 134 Adelie Torgersen 41.5 18.3 ## 135 Adelie Dream 41.5 18.5 ## 136 Adelie Biscoe 41.6 18.0 ## 137 Gentoo Biscoe 41.7 14.7 ## 138 Adelie Torgersen 41.8 19.4 ## 139 Adelie Torgersen 42.0 20.2 ## 140 Adelie Biscoe 42.0 19.5 ## 141 Gentoo Biscoe 42.0 13.5 ## 142 Adelie Torgersen 42.1 19.1 ## 143 Adelie Dream 42.2 18.5 ## 144 Adelie Biscoe 42.2 19.5 ## 145 Adelie Dream 42.3 21.2 ## 146 Chinstrap Dream 42.4 17.3 ## 147 Adelie Torgersen 42.5 20.7 ## 148 Chinstrap Dream 42.5 16.7 ## 149 Chinstrap Dream 42.5 17.3 ## 150 Gentoo Biscoe 42.6 13.7 ## 151 Adelie Biscoe 42.7 18.3 ## 152 Gentoo Biscoe 42.7 13.7 ## 153 Adelie Torgersen 42.8 18.5 ## 154 Gentoo Biscoe 42.8 14.2 ## 155 Adelie Torgersen 42.9 17.6 ## 156 Gentoo Biscoe 42.9 13.1 ## 157 Adelie Torgersen 43.1 19.2 ## 158 Adelie Dream 43.2 18.5 ## 159 Adelie Biscoe 43.2 19.0 ## 160 Gentoo Biscoe 43.2 14.5 ## 161 Chinstrap Dream 43.2 16.6 ## 162 Gentoo Biscoe 43.3 13.4 ## 163 Gentoo Biscoe 43.3 14.0 ## 164 Gentoo Biscoe 43.4 14.4 ## 165 Gentoo Biscoe 43.5 14.2 ## 166 Gentoo Biscoe 43.5 15.2 ## 167 Chinstrap Dream 43.5 18.1 ## 168 Gentoo Biscoe 43.6 13.9 ## 169 Gentoo Biscoe 43.8 13.9 ## 170 Gentoo Biscoe 44.0 13.6 ## 171 Adelie Dream 44.1 19.7 ## 172 Adelie Torgersen 44.1 18.0 ## 173 Gentoo Biscoe 44.4 17.3 ## 174 Gentoo Biscoe 44.5 14.3 ## 175 Gentoo Biscoe 44.5 14.7 ## 176 Gentoo Biscoe 44.5 15.7 ## 177 Gentoo Biscoe 44.9 13.3 ## 178 Gentoo Biscoe 44.9 13.8 ## 179 Gentoo Biscoe 45.0 15.4 ## 180 Gentoo Biscoe 45.1 14.5 ## 181 Gentoo Biscoe 45.1 14.5 ## 182 Gentoo Biscoe 45.1 14.4 ## 183 Gentoo Biscoe 45.2 15.8 ## 184 Gentoo Biscoe 45.2 13.8 ## 185 Gentoo Biscoe 45.2 16.4 ## 186 Gentoo Biscoe 45.2 14.8 ## 187 Chinstrap Dream 45.2 17.8 ## 188 Chinstrap Dream 45.2 16.6 ## 189 Gentoo Biscoe 45.3 13.7 ## 190 Gentoo Biscoe 45.3 13.8 ## 191 Gentoo Biscoe 45.4 14.6 ## 192 Chinstrap Dream 45.4 18.7 ## 193 Gentoo Biscoe 45.5 13.7 ## 194 Gentoo Biscoe 45.5 13.9 ## 195 Gentoo Biscoe 45.5 15.0 ## 196 Gentoo Biscoe 45.5 14.5 ## 197 Chinstrap Dream 45.5 17.0 ## 198 Adelie Biscoe 45.6 20.3 ## 199 Chinstrap Dream 45.6 19.4 ## 200 Gentoo Biscoe 45.7 13.9 ## 201 Chinstrap Dream 45.7 17.3 ## 202 Chinstrap Dream 45.7 17.0 ## 203 Adelie Torgersen 45.8 18.9 ## 204 Gentoo Biscoe 45.8 14.6 ## 205 Gentoo Biscoe 45.8 14.2 ## 206 Chinstrap Dream 45.9 17.1 ## 207 Adelie Torgersen 46.0 21.5 ## 208 Chinstrap Dream 46.0 18.9 ## 209 Gentoo Biscoe 46.1 13.2 ## 210 Gentoo Biscoe 46.1 15.1 ## 211 Chinstrap Dream 46.1 18.2 ## 212 Gentoo Biscoe 46.2 14.5 ## 213 Gentoo Biscoe 46.2 14.9 ## 214 Gentoo Biscoe 46.2 14.4 ## 215 Gentoo Biscoe 46.2 14.1 ## 216 Chinstrap Dream 46.2 17.5 ## 217 Gentoo Biscoe 46.3 15.8 ## 218 Gentoo Biscoe 46.4 15.6 ## 219 Gentoo Biscoe 46.4 15.0 ## 220 Chinstrap Dream 46.4 18.6 ## 221 Chinstrap Dream 46.4 17.8 ## 222 Gentoo Biscoe 46.5 13.5 ## 223 Gentoo Biscoe 46.5 14.5 ## 224 Gentoo Biscoe 46.5 14.4 ## 225 Gentoo Biscoe 46.5 14.8 ## 226 Chinstrap Dream 46.5 17.9 ## 227 Gentoo Biscoe 46.6 14.2 ## 228 Chinstrap Dream 46.6 17.8 ## 229 Gentoo Biscoe 46.7 15.3 ## 230 Chinstrap Dream 46.7 17.9 ## 231 Gentoo Biscoe 46.8 15.4 ## 232 Gentoo Biscoe 46.8 16.1 ## 233 Gentoo Biscoe 46.8 14.3 ## 234 Chinstrap Dream 46.8 16.5 ## 235 Gentoo Biscoe 46.9 14.6 ## 236 Chinstrap Dream 46.9 16.6 ## 237 Chinstrap Dream 47.0 17.3 ## 238 Gentoo Biscoe 47.2 15.5 ## 239 Gentoo Biscoe 47.2 13.7 ## 240 Gentoo Biscoe 47.3 15.3 ## 241 Gentoo Biscoe 47.3 13.8 ## 242 Gentoo Biscoe 47.4 14.6 ## 243 Gentoo Biscoe 47.5 14.2 ## 244 Gentoo Biscoe 47.5 14.0 ## 245 Gentoo Biscoe 47.5 15.0 ## 246 Chinstrap Dream 47.5 16.8 ## 247 Gentoo Biscoe 47.6 14.5 ## 248 Chinstrap Dream 47.6 18.3 ## 249 Gentoo Biscoe 47.7 15.0 ## 250 Gentoo Biscoe 47.8 15.0 ## 251 Gentoo Biscoe 48.1 15.1 ## 252 Chinstrap Dream 48.1 16.4 ## 253 Gentoo Biscoe 48.2 14.3 ## 254 Gentoo Biscoe 48.2 15.6 ## 255 Gentoo Biscoe 48.4 14.6 ## 256 Gentoo Biscoe 48.4 16.3 ## 257 Gentoo Biscoe 48.4 14.4 ## 258 Gentoo Biscoe 48.5 14.1 ## 259 Gentoo Biscoe 48.5 15.0 ## 260 Chinstrap Dream 48.5 17.5 ## 261 Gentoo Biscoe 48.6 16.0 ## 262 Gentoo Biscoe 48.7 14.1 ## 263 Gentoo Biscoe 48.7 15.1 ## 264 Gentoo Biscoe 48.7 15.7 ## 265 Gentoo Biscoe 48.8 16.2 ## 266 Gentoo Biscoe 49.0 16.1 ## 267 Chinstrap Dream 49.0 19.5 ## 268 Chinstrap Dream 49.0 19.6 ## 269 Gentoo Biscoe 49.1 14.8 ## 270 Gentoo Biscoe 49.1 14.5 ## 271 Gentoo Biscoe 49.1 15.0 ## 272 Gentoo Biscoe 49.2 15.2 ## 273 Chinstrap Dream 49.2 18.2 ## 274 Gentoo Biscoe 49.3 15.7 ## 275 Chinstrap Dream 49.3 19.9 ## 276 Gentoo Biscoe 49.4 15.8 ## 277 Gentoo Biscoe 49.5 16.2 ## 278 Gentoo Biscoe 49.5 16.1 ## 279 Chinstrap Dream 49.5 19.0 ## 280 Gentoo Biscoe 49.6 16.0 ## 281 Gentoo Biscoe 49.6 15.0 ## 282 Chinstrap Dream 49.6 18.2 ## 283 Chinstrap Dream 49.7 18.6 ## 284 Gentoo Biscoe 49.8 16.8 ## 285 Gentoo Biscoe 49.8 15.9 ## 286 Chinstrap Dream 49.8 17.3 ## 287 Gentoo Biscoe 49.9 16.1 ## 288 Gentoo Biscoe 50.0 16.3 ## 289 Gentoo Biscoe 50.0 15.2 ## 290 Gentoo Biscoe 50.0 15.3 ## 291 Gentoo Biscoe 50.0 15.9 ## 292 Chinstrap Dream 50.0 19.5 ## 293 Gentoo Biscoe 50.1 15.0 ## 294 Chinstrap Dream 50.1 17.9 ## 295 Gentoo Biscoe 50.2 14.3 ## 296 Chinstrap Dream 50.2 18.8 ## 297 Chinstrap Dream 50.2 18.7 ## 298 Chinstrap Dream 50.3 20.0 ## 299 Gentoo Biscoe 50.4 15.3 ## 300 Gentoo Biscoe 50.4 15.7 ## 301 Gentoo Biscoe 50.5 15.9 ## 302 Gentoo Biscoe 50.5 15.9 ## 303 Gentoo Biscoe 50.5 15.2 ## 304 Chinstrap Dream 50.5 19.6 ## 305 Chinstrap Dream 50.5 18.4 ## 306 Chinstrap Dream 50.6 19.4 ## 307 Gentoo Biscoe 50.7 15.0 ## 308 Chinstrap Dream 50.7 19.7 ## 309 Gentoo Biscoe 50.8 17.3 ## 310 Gentoo Biscoe 50.8 15.7 ## 311 Chinstrap Dream 50.8 18.5 ## 312 Chinstrap Dream 50.8 19.0 ## 313 Chinstrap Dream 50.9 19.1 ## 314 Chinstrap Dream 50.9 17.9 ## 315 Chinstrap Dream 51.0 18.8 ## 316 Gentoo Biscoe 51.1 16.3 ## 317 Gentoo Biscoe 51.1 16.5 ## 318 Gentoo Biscoe 51.3 14.2 ## 319 Chinstrap Dream 51.3 19.2 ## 320 Chinstrap Dream 51.3 18.2 ## 321 Chinstrap Dream 51.3 19.9 ## 322 Chinstrap Dream 51.4 19.0 ## 323 Gentoo Biscoe 51.5 16.3 ## 324 Chinstrap Dream 51.5 18.7 ## 325 Chinstrap Dream 51.7 20.3 ## 326 Chinstrap Dream 51.9 19.5 ## 327 Chinstrap Dream 52.0 18.1 ## 328 Chinstrap Dream 52.0 19.0 ## 329 Chinstrap Dream 52.0 20.7 ## 330 Gentoo Biscoe 52.1 17.0 ## 331 Gentoo Biscoe 52.2 17.1 ## 332 Chinstrap Dream 52.2 18.8 ## 333 Gentoo Biscoe 52.5 15.6 ## 334 Chinstrap Dream 52.7 19.8 ## 335 Chinstrap Dream 52.8 20.0 ## 336 Gentoo Biscoe 53.4 15.8 ## 337 Chinstrap Dream 53.5 19.9 ## 338 Chinstrap Dream 54.2 20.8 ## 339 Gentoo Biscoe 54.3 15.7 ## 340 Gentoo Biscoe 55.1 16.0 ## 341 Chinstrap Dream 55.8 19.8 ## 342 Gentoo Biscoe 55.9 17.0 ## 343 Chinstrap Dream 58.0 17.8 ## 344 Gentoo Biscoe 59.6 17.0 ``` --- # Order by clause ```sql SELECT species, island, bill_length_mm, bill_depth_mm FROM penguins ORDER BY bill_length_mm DESC ``` ``` ## species island bill_length_mm bill_depth_mm ## 1 Gentoo Biscoe 59.6 17.0 ## 2 Chinstrap Dream 58.0 17.8 ## 3 Gentoo Biscoe 55.9 17.0 ## 4 Chinstrap Dream 55.8 19.8 ## 5 Gentoo Biscoe 55.1 16.0 ## 6 Gentoo Biscoe 54.3 15.7 ## 7 Chinstrap Dream 54.2 20.8 ## 8 Chinstrap Dream 53.5 19.9 ## 9 Gentoo Biscoe 53.4 15.8 ## 10 Chinstrap Dream 52.8 20.0 ## 11 Chinstrap Dream 52.7 19.8 ## 12 Gentoo Biscoe 52.5 15.6 ## 13 Gentoo Biscoe 52.2 17.1 ## 14 Chinstrap Dream 52.2 18.8 ## 15 Gentoo Biscoe 52.1 17.0 ## 16 Chinstrap Dream 52.0 18.1 ## 17 Chinstrap Dream 52.0 19.0 ## 18 Chinstrap Dream 52.0 20.7 ## 19 Chinstrap Dream 51.9 19.5 ## 20 Chinstrap Dream 51.7 20.3 ## 21 Gentoo Biscoe 51.5 16.3 ## 22 Chinstrap Dream 51.5 18.7 ## 23 Chinstrap Dream 51.4 19.0 ## 24 Gentoo Biscoe 51.3 14.2 ## 25 Chinstrap Dream 51.3 19.2 ## 26 Chinstrap Dream 51.3 18.2 ## 27 Chinstrap Dream 51.3 19.9 ## 28 Gentoo Biscoe 51.1 16.3 ## 29 Gentoo Biscoe 51.1 16.5 ## 30 Chinstrap Dream 51.0 18.8 ## 31 Chinstrap Dream 50.9 19.1 ## 32 Chinstrap Dream 50.9 17.9 ## 33 Gentoo Biscoe 50.8 17.3 ## 34 Gentoo Biscoe 50.8 15.7 ## 35 Chinstrap Dream 50.8 18.5 ## 36 Chinstrap Dream 50.8 19.0 ## 37 Gentoo Biscoe 50.7 15.0 ## 38 Chinstrap Dream 50.7 19.7 ## 39 Chinstrap Dream 50.6 19.4 ## 40 Gentoo Biscoe 50.5 15.9 ## 41 Gentoo Biscoe 50.5 15.9 ## 42 Gentoo Biscoe 50.5 15.2 ## 43 Chinstrap Dream 50.5 19.6 ## 44 Chinstrap Dream 50.5 18.4 ## 45 Gentoo Biscoe 50.4 15.3 ## 46 Gentoo Biscoe 50.4 15.7 ## 47 Chinstrap Dream 50.3 20.0 ## 48 Gentoo Biscoe 50.2 14.3 ## 49 Chinstrap Dream 50.2 18.8 ## 50 Chinstrap Dream 50.2 18.7 ## 51 Gentoo Biscoe 50.1 15.0 ## 52 Chinstrap Dream 50.1 17.9 ## 53 Gentoo Biscoe 50.0 16.3 ## 54 Gentoo Biscoe 50.0 15.2 ## 55 Gentoo Biscoe 50.0 15.3 ## 56 Gentoo Biscoe 50.0 15.9 ## 57 Chinstrap Dream 50.0 19.5 ## 58 Gentoo Biscoe 49.9 16.1 ## 59 Gentoo Biscoe 49.8 16.8 ## 60 Gentoo Biscoe 49.8 15.9 ## 61 Chinstrap Dream 49.8 17.3 ## 62 Chinstrap Dream 49.7 18.6 ## 63 Gentoo Biscoe 49.6 16.0 ## 64 Gentoo Biscoe 49.6 15.0 ## 65 Chinstrap Dream 49.6 18.2 ## 66 Gentoo Biscoe 49.5 16.2 ## 67 Gentoo Biscoe 49.5 16.1 ## 68 Chinstrap Dream 49.5 19.0 ## 69 Gentoo Biscoe 49.4 15.8 ## 70 Gentoo Biscoe 49.3 15.7 ## 71 Chinstrap Dream 49.3 19.9 ## 72 Gentoo Biscoe 49.2 15.2 ## 73 Chinstrap Dream 49.2 18.2 ## 74 Gentoo Biscoe 49.1 14.8 ## 75 Gentoo Biscoe 49.1 14.5 ## 76 Gentoo Biscoe 49.1 15.0 ## 77 Gentoo Biscoe 49.0 16.1 ## 78 Chinstrap Dream 49.0 19.5 ## 79 Chinstrap Dream 49.0 19.6 ## 80 Gentoo Biscoe 48.8 16.2 ## 81 Gentoo Biscoe 48.7 14.1 ## 82 Gentoo Biscoe 48.7 15.1 ## 83 Gentoo Biscoe 48.7 15.7 ## 84 Gentoo Biscoe 48.6 16.0 ## 85 Gentoo Biscoe 48.5 14.1 ## 86 Gentoo Biscoe 48.5 15.0 ## 87 Chinstrap Dream 48.5 17.5 ## 88 Gentoo Biscoe 48.4 14.6 ## 89 Gentoo Biscoe 48.4 16.3 ## 90 Gentoo Biscoe 48.4 14.4 ## 91 Gentoo Biscoe 48.2 14.3 ## 92 Gentoo Biscoe 48.2 15.6 ## 93 Gentoo Biscoe 48.1 15.1 ## 94 Chinstrap Dream 48.1 16.4 ## 95 Gentoo Biscoe 47.8 15.0 ## 96 Gentoo Biscoe 47.7 15.0 ## 97 Gentoo Biscoe 47.6 14.5 ## 98 Chinstrap Dream 47.6 18.3 ## 99 Gentoo Biscoe 47.5 14.2 ## 100 Gentoo Biscoe 47.5 14.0 ## 101 Gentoo Biscoe 47.5 15.0 ## 102 Chinstrap Dream 47.5 16.8 ## 103 Gentoo Biscoe 47.4 14.6 ## 104 Gentoo Biscoe 47.3 15.3 ## 105 Gentoo Biscoe 47.3 13.8 ## 106 Gentoo Biscoe 47.2 15.5 ## 107 Gentoo Biscoe 47.2 13.7 ## 108 Chinstrap Dream 47.0 17.3 ## 109 Gentoo Biscoe 46.9 14.6 ## 110 Chinstrap Dream 46.9 16.6 ## 111 Gentoo Biscoe 46.8 15.4 ## 112 Gentoo Biscoe 46.8 16.1 ## 113 Gentoo Biscoe 46.8 14.3 ## 114 Chinstrap Dream 46.8 16.5 ## 115 Gentoo Biscoe 46.7 15.3 ## 116 Chinstrap Dream 46.7 17.9 ## 117 Gentoo Biscoe 46.6 14.2 ## 118 Chinstrap Dream 46.6 17.8 ## 119 Gentoo Biscoe 46.5 13.5 ## 120 Gentoo Biscoe 46.5 14.5 ## 121 Gentoo Biscoe 46.5 14.4 ## 122 Gentoo Biscoe 46.5 14.8 ## 123 Chinstrap Dream 46.5 17.9 ## 124 Gentoo Biscoe 46.4 15.6 ## 125 Gentoo Biscoe 46.4 15.0 ## 126 Chinstrap Dream 46.4 18.6 ## 127 Chinstrap Dream 46.4 17.8 ## 128 Gentoo Biscoe 46.3 15.8 ## 129 Gentoo Biscoe 46.2 14.5 ## 130 Gentoo Biscoe 46.2 14.9 ## 131 Gentoo Biscoe 46.2 14.4 ## 132 Gentoo Biscoe 46.2 14.1 ## 133 Chinstrap Dream 46.2 17.5 ## 134 Gentoo Biscoe 46.1 13.2 ## 135 Gentoo Biscoe 46.1 15.1 ## 136 Chinstrap Dream 46.1 18.2 ## 137 Adelie Torgersen 46.0 21.5 ## 138 Chinstrap Dream 46.0 18.9 ## 139 Chinstrap Dream 45.9 17.1 ## 140 Adelie Torgersen 45.8 18.9 ## 141 Gentoo Biscoe 45.8 14.6 ## 142 Gentoo Biscoe 45.8 14.2 ## 143 Gentoo Biscoe 45.7 13.9 ## 144 Chinstrap Dream 45.7 17.3 ## 145 Chinstrap Dream 45.7 17.0 ## 146 Adelie Biscoe 45.6 20.3 ## 147 Chinstrap Dream 45.6 19.4 ## 148 Gentoo Biscoe 45.5 13.7 ## 149 Gentoo Biscoe 45.5 13.9 ## 150 Gentoo Biscoe 45.5 15.0 ## 151 Gentoo Biscoe 45.5 14.5 ## 152 Chinstrap Dream 45.5 17.0 ## 153 Gentoo Biscoe 45.4 14.6 ## 154 Chinstrap Dream 45.4 18.7 ## 155 Gentoo Biscoe 45.3 13.7 ## 156 Gentoo Biscoe 45.3 13.8 ## 157 Gentoo Biscoe 45.2 15.8 ## 158 Gentoo Biscoe 45.2 13.8 ## 159 Gentoo Biscoe 45.2 16.4 ## 160 Gentoo Biscoe 45.2 14.8 ## 161 Chinstrap Dream 45.2 17.8 ## 162 Chinstrap Dream 45.2 16.6 ## 163 Gentoo Biscoe 45.1 14.5 ## 164 Gentoo Biscoe 45.1 14.5 ## 165 Gentoo Biscoe 45.1 14.4 ## 166 Gentoo Biscoe 45.0 15.4 ## 167 Gentoo Biscoe 44.9 13.3 ## 168 Gentoo Biscoe 44.9 13.8 ## 169 Gentoo Biscoe 44.5 14.3 ## 170 Gentoo Biscoe 44.5 14.7 ## 171 Gentoo Biscoe 44.5 15.7 ## 172 Gentoo Biscoe 44.4 17.3 ## 173 Adelie Dream 44.1 19.7 ## 174 Adelie Torgersen 44.1 18.0 ## 175 Gentoo Biscoe 44.0 13.6 ## 176 Gentoo Biscoe 43.8 13.9 ## 177 Gentoo Biscoe 43.6 13.9 ## 178 Gentoo Biscoe 43.5 14.2 ## 179 Gentoo Biscoe 43.5 15.2 ## 180 Chinstrap Dream 43.5 18.1 ## 181 Gentoo Biscoe 43.4 14.4 ## 182 Gentoo Biscoe 43.3 13.4 ## 183 Gentoo Biscoe 43.3 14.0 ## 184 Adelie Dream 43.2 18.5 ## 185 Adelie Biscoe 43.2 19.0 ## 186 Gentoo Biscoe 43.2 14.5 ## 187 Chinstrap Dream 43.2 16.6 ## 188 Adelie Torgersen 43.1 19.2 ## 189 Adelie Torgersen 42.9 17.6 ## 190 Gentoo Biscoe 42.9 13.1 ## 191 Adelie Torgersen 42.8 18.5 ## 192 Gentoo Biscoe 42.8 14.2 ## 193 Adelie Biscoe 42.7 18.3 ## 194 Gentoo Biscoe 42.7 13.7 ## 195 Gentoo Biscoe 42.6 13.7 ## 196 Adelie Torgersen 42.5 20.7 ## 197 Chinstrap Dream 42.5 16.7 ## 198 Chinstrap Dream 42.5 17.3 ## 199 Chinstrap Dream 42.4 17.3 ## 200 Adelie Dream 42.3 21.2 ## 201 Adelie Dream 42.2 18.5 ## 202 Adelie Biscoe 42.2 19.5 ## 203 Adelie Torgersen 42.1 19.1 ## 204 Adelie Torgersen 42.0 20.2 ## 205 Adelie Biscoe 42.0 19.5 ## 206 Gentoo Biscoe 42.0 13.5 ## 207 Adelie Torgersen 41.8 19.4 ## 208 Gentoo Biscoe 41.7 14.7 ## 209 Adelie Biscoe 41.6 18.0 ## 210 Adelie Torgersen 41.5 18.3 ## 211 Adelie Dream 41.5 18.5 ## 212 Adelie Biscoe 41.4 18.6 ## 213 Adelie Torgersen 41.4 18.5 ## 214 Adelie Biscoe 41.3 21.1 ## 215 Adelie Dream 41.3 20.3 ## 216 Adelie Torgersen 41.1 17.6 ## 217 Adelie Dream 41.1 19.0 ## 218 Adelie Biscoe 41.1 18.2 ## 219 Adelie Biscoe 41.1 19.1 ## 220 Adelie Dream 41.1 18.1 ## 221 Adelie Torgersen 41.1 18.6 ## 222 Adelie Dream 41.1 17.5 ## 223 Adelie Biscoe 41.0 20.0 ## 224 Adelie Dream 40.9 18.9 ## 225 Adelie Torgersen 40.9 16.8 ## 226 Gentoo Biscoe 40.9 13.7 ## 227 Chinstrap Dream 40.9 16.6 ## 228 Adelie Dream 40.8 18.4 ## 229 Adelie Dream 40.8 18.9 ## 230 Adelie Dream 40.7 17.0 ## 231 Adelie Biscoe 40.6 18.6 ## 232 Adelie Biscoe 40.6 18.8 ## 233 Adelie Torgersen 40.6 19.0 ## 234 Adelie Dream 40.6 17.2 ## 235 Adelie Biscoe 40.5 17.9 ## 236 Adelie Biscoe 40.5 18.9 ## 237 Adelie Torgersen 40.3 18.0 ## 238 Adelie Dream 40.3 18.5 ## 239 Adelie Torgersen 40.2 17.0 ## 240 Adelie Dream 40.2 20.1 ## 241 Adelie Dream 40.2 17.1 ## 242 Adelie Biscoe 40.1 18.9 ## 243 Adelie Dream 39.8 19.1 ## 244 Adelie Torgersen 39.7 18.4 ## 245 Adelie Biscoe 39.7 18.9 ## 246 Adelie Biscoe 39.7 17.7 ## 247 Adelie Dream 39.7 17.9 ## 248 Adelie Dream 39.6 18.8 ## 249 Adelie Biscoe 39.6 17.7 ## 250 Adelie Torgersen 39.6 17.2 ## 251 Adelie Dream 39.6 18.1 ## 252 Adelie Biscoe 39.6 20.7 ## 253 Adelie Torgersen 39.5 17.4 ## 254 Adelie Dream 39.5 16.7 ## 255 Adelie Dream 39.5 17.8 ## 256 Adelie Torgersen 39.3 20.6 ## 257 Adelie Torgersen 39.2 19.6 ## 258 Adelie Dream 39.2 21.1 ## 259 Adelie Dream 39.2 18.6 ## 260 Adelie Torgersen 39.1 18.7 ## 261 Adelie Biscoe 39.0 17.5 ## 262 Adelie Torgersen 39.0 17.1 ## 263 Adelie Dream 39.0 18.7 ## 264 Adelie Torgersen 38.9 17.8 ## 265 Adelie Dream 38.9 18.8 ## 266 Adelie Biscoe 38.8 17.2 ## 267 Adelie Dream 38.8 20.0 ## 268 Adelie Torgersen 38.8 17.6 ## 269 Adelie Torgersen 38.7 19.0 ## 270 Adelie Torgersen 38.6 21.2 ## 271 Adelie Biscoe 38.6 17.2 ## 272 Adelie Torgersen 38.6 17.0 ## 273 Adelie Torgersen 38.5 17.9 ## 274 Adelie Dream 38.3 19.2 ## 275 Adelie Biscoe 38.2 18.1 ## 276 Adelie Biscoe 38.2 20.0 ## 277 Adelie Dream 38.1 18.6 ## 278 Adelie Biscoe 38.1 17.0 ## 279 Adelie Biscoe 38.1 16.5 ## 280 Adelie Dream 38.1 17.6 ## 281 Adelie Biscoe 37.9 18.6 ## 282 Adelie Biscoe 37.9 18.6 ## 283 Adelie Torgersen 37.8 17.1 ## 284 Adelie Torgersen 37.8 17.3 ## 285 Adelie Biscoe 37.8 18.3 ## 286 Adelie Biscoe 37.8 20.0 ## 287 Adelie Dream 37.8 18.1 ## 288 Adelie Biscoe 37.7 18.7 ## 289 Adelie Biscoe 37.7 16.0 ## 290 Adelie Torgersen 37.7 19.8 ## 291 Adelie Dream 37.6 19.3 ## 292 Adelie Biscoe 37.6 19.1 ## 293 Adelie Biscoe 37.6 17.0 ## 294 Adelie Dream 37.5 18.9 ## 295 Adelie Dream 37.5 18.5 ## 296 Adelie Dream 37.3 17.8 ## 297 Adelie Torgersen 37.3 20.5 ## 298 Adelie Dream 37.3 16.8 ## 299 Adelie Dream 37.2 18.1 ## 300 Adelie Torgersen 37.2 19.4 ## 301 Adelie Dream 37.0 16.9 ## 302 Adelie Dream 37.0 16.5 ## 303 Adelie Dream 36.9 18.6 ## 304 Adelie Dream 36.8 18.5 ## 305 Adelie Torgersen 36.7 19.3 ## 306 Adelie Torgersen 36.7 18.8 ## 307 Adelie Torgersen 36.6 17.8 ## 308 Adelie Dream 36.6 18.4 ## 309 Adelie Dream 36.5 18.0 ## 310 Adelie Biscoe 36.5 16.6 ## 311 Adelie Dream 36.4 17.0 ## 312 Adelie Biscoe 36.4 17.1 ## 313 Adelie Dream 36.3 19.5 ## 314 Adelie Torgersen 36.2 16.1 ## 315 Adelie Dream 36.2 17.3 ## 316 Adelie Torgersen 36.2 17.2 ## 317 Adelie Dream 36.0 18.5 ## 318 Adelie Dream 36.0 17.9 ## 319 Adelie Dream 36.0 17.8 ## 320 Adelie Dream 36.0 17.1 ## 321 Adelie Biscoe 35.9 19.2 ## 322 Adelie Torgersen 35.9 16.6 ## 323 Adelie Biscoe 35.7 16.9 ## 324 Adelie Dream 35.7 18.0 ## 325 Adelie Torgersen 35.7 17.0 ## 326 Adelie Dream 35.6 17.5 ## 327 Adelie Biscoe 35.5 16.2 ## 328 Adelie Torgersen 35.5 17.5 ## 329 Adelie Biscoe 35.3 18.9 ## 330 Adelie Torgersen 35.2 15.9 ## 331 Adelie Torgersen 35.1 19.4 ## 332 Adelie Biscoe 35.0 17.9 ## 333 Adelie Biscoe 35.0 17.9 ## 334 Adelie Torgersen 34.6 21.1 ## 335 Adelie Torgersen 34.6 17.2 ## 336 Adelie Biscoe 34.5 18.1 ## 337 Adelie Torgersen 34.4 18.4 ## 338 Adelie Torgersen 34.1 18.1 ## 339 Adelie Dream 34.0 17.1 ## 340 Adelie Torgersen 33.5 19.0 ## 341 Adelie Dream 33.1 16.1 ## 342 Adelie Dream 32.1 15.5 ## 343 Adelie Torgersen NA NA ## 344 Gentoo Biscoe NA NA ``` --- # Order by clause ```sql SELECT species, island, bill_length_mm, bill_depth_mm FROM penguins ORDER BY bill_length_mm ASC ``` ``` ## species island bill_length_mm bill_depth_mm ## 1 Adelie Torgersen NA NA ## 2 Gentoo Biscoe NA NA ## 3 Adelie Dream 32.1 15.5 ## 4 Adelie Dream 33.1 16.1 ## 5 Adelie Torgersen 33.5 19.0 ## 6 Adelie Dream 34.0 17.1 ## 7 Adelie Torgersen 34.1 18.1 ## 8 Adelie Torgersen 34.4 18.4 ## 9 Adelie Biscoe 34.5 18.1 ## 10 Adelie Torgersen 34.6 21.1 ## 11 Adelie Torgersen 34.6 17.2 ## 12 Adelie Biscoe 35.0 17.9 ## 13 Adelie Biscoe 35.0 17.9 ## 14 Adelie Torgersen 35.1 19.4 ## 15 Adelie Torgersen 35.2 15.9 ## 16 Adelie Biscoe 35.3 18.9 ## 17 Adelie Biscoe 35.5 16.2 ## 18 Adelie Torgersen 35.5 17.5 ## 19 Adelie Dream 35.6 17.5 ## 20 Adelie Biscoe 35.7 16.9 ## 21 Adelie Dream 35.7 18.0 ## 22 Adelie Torgersen 35.7 17.0 ## 23 Adelie Biscoe 35.9 19.2 ## 24 Adelie Torgersen 35.9 16.6 ## 25 Adelie Dream 36.0 18.5 ## 26 Adelie Dream 36.0 17.9 ## 27 Adelie Dream 36.0 17.8 ## 28 Adelie Dream 36.0 17.1 ## 29 Adelie Torgersen 36.2 16.1 ## 30 Adelie Dream 36.2 17.3 ## 31 Adelie Torgersen 36.2 17.2 ## 32 Adelie Dream 36.3 19.5 ## 33 Adelie Dream 36.4 17.0 ## 34 Adelie Biscoe 36.4 17.1 ## 35 Adelie Dream 36.5 18.0 ## 36 Adelie Biscoe 36.5 16.6 ## 37 Adelie Torgersen 36.6 17.8 ## 38 Adelie Dream 36.6 18.4 ## 39 Adelie Torgersen 36.7 19.3 ## 40 Adelie Torgersen 36.7 18.8 ## 41 Adelie Dream 36.8 18.5 ## 42 Adelie Dream 36.9 18.6 ## 43 Adelie Dream 37.0 16.9 ## 44 Adelie Dream 37.0 16.5 ## 45 Adelie Dream 37.2 18.1 ## 46 Adelie Torgersen 37.2 19.4 ## 47 Adelie Dream 37.3 17.8 ## 48 Adelie Torgersen 37.3 20.5 ## 49 Adelie Dream 37.3 16.8 ## 50 Adelie Dream 37.5 18.9 ## 51 Adelie Dream 37.5 18.5 ## 52 Adelie Dream 37.6 19.3 ## 53 Adelie Biscoe 37.6 19.1 ## 54 Adelie Biscoe 37.6 17.0 ## 55 Adelie Biscoe 37.7 18.7 ## 56 Adelie Biscoe 37.7 16.0 ## 57 Adelie Torgersen 37.7 19.8 ## 58 Adelie Torgersen 37.8 17.1 ## 59 Adelie Torgersen 37.8 17.3 ## 60 Adelie Biscoe 37.8 18.3 ## 61 Adelie Biscoe 37.8 20.0 ## 62 Adelie Dream 37.8 18.1 ## 63 Adelie Biscoe 37.9 18.6 ## 64 Adelie Biscoe 37.9 18.6 ## 65 Adelie Dream 38.1 18.6 ## 66 Adelie Biscoe 38.1 17.0 ## 67 Adelie Biscoe 38.1 16.5 ## 68 Adelie Dream 38.1 17.6 ## 69 Adelie Biscoe 38.2 18.1 ## 70 Adelie Biscoe 38.2 20.0 ## 71 Adelie Dream 38.3 19.2 ## 72 Adelie Torgersen 38.5 17.9 ## 73 Adelie Torgersen 38.6 21.2 ## 74 Adelie Biscoe 38.6 17.2 ## 75 Adelie Torgersen 38.6 17.0 ## 76 Adelie Torgersen 38.7 19.0 ## 77 Adelie Biscoe 38.8 17.2 ## 78 Adelie Dream 38.8 20.0 ## 79 Adelie Torgersen 38.8 17.6 ## 80 Adelie Torgersen 38.9 17.8 ## 81 Adelie Dream 38.9 18.8 ## 82 Adelie Biscoe 39.0 17.5 ## 83 Adelie Torgersen 39.0 17.1 ## 84 Adelie Dream 39.0 18.7 ## 85 Adelie Torgersen 39.1 18.7 ## 86 Adelie Torgersen 39.2 19.6 ## 87 Adelie Dream 39.2 21.1 ## 88 Adelie Dream 39.2 18.6 ## 89 Adelie Torgersen 39.3 20.6 ## 90 Adelie Torgersen 39.5 17.4 ## 91 Adelie Dream 39.5 16.7 ## 92 Adelie Dream 39.5 17.8 ## 93 Adelie Dream 39.6 18.8 ## 94 Adelie Biscoe 39.6 17.7 ## 95 Adelie Torgersen 39.6 17.2 ## 96 Adelie Dream 39.6 18.1 ## 97 Adelie Biscoe 39.6 20.7 ## 98 Adelie Torgersen 39.7 18.4 ## 99 Adelie Biscoe 39.7 18.9 ## 100 Adelie Biscoe 39.7 17.7 ## 101 Adelie Dream 39.7 17.9 ## 102 Adelie Dream 39.8 19.1 ## 103 Adelie Biscoe 40.1 18.9 ## 104 Adelie Torgersen 40.2 17.0 ## 105 Adelie Dream 40.2 20.1 ## 106 Adelie Dream 40.2 17.1 ## 107 Adelie Torgersen 40.3 18.0 ## 108 Adelie Dream 40.3 18.5 ## 109 Adelie Biscoe 40.5 17.9 ## 110 Adelie Biscoe 40.5 18.9 ## 111 Adelie Biscoe 40.6 18.6 ## 112 Adelie Biscoe 40.6 18.8 ## 113 Adelie Torgersen 40.6 19.0 ## 114 Adelie Dream 40.6 17.2 ## 115 Adelie Dream 40.7 17.0 ## 116 Adelie Dream 40.8 18.4 ## 117 Adelie Dream 40.8 18.9 ## 118 Adelie Dream 40.9 18.9 ## 119 Adelie Torgersen 40.9 16.8 ## 120 Gentoo Biscoe 40.9 13.7 ## 121 Chinstrap Dream 40.9 16.6 ## 122 Adelie Biscoe 41.0 20.0 ## 123 Adelie Torgersen 41.1 17.6 ## 124 Adelie Dream 41.1 19.0 ## 125 Adelie Biscoe 41.1 18.2 ## 126 Adelie Biscoe 41.1 19.1 ## 127 Adelie Dream 41.1 18.1 ## 128 Adelie Torgersen 41.1 18.6 ## 129 Adelie Dream 41.1 17.5 ## 130 Adelie Biscoe 41.3 21.1 ## 131 Adelie Dream 41.3 20.3 ## 132 Adelie Biscoe 41.4 18.6 ## 133 Adelie Torgersen 41.4 18.5 ## 134 Adelie Torgersen 41.5 18.3 ## 135 Adelie Dream 41.5 18.5 ## 136 Adelie Biscoe 41.6 18.0 ## 137 Gentoo Biscoe 41.7 14.7 ## 138 Adelie Torgersen 41.8 19.4 ## 139 Adelie Torgersen 42.0 20.2 ## 140 Adelie Biscoe 42.0 19.5 ## 141 Gentoo Biscoe 42.0 13.5 ## 142 Adelie Torgersen 42.1 19.1 ## 143 Adelie Dream 42.2 18.5 ## 144 Adelie Biscoe 42.2 19.5 ## 145 Adelie Dream 42.3 21.2 ## 146 Chinstrap Dream 42.4 17.3 ## 147 Adelie Torgersen 42.5 20.7 ## 148 Chinstrap Dream 42.5 16.7 ## 149 Chinstrap Dream 42.5 17.3 ## 150 Gentoo Biscoe 42.6 13.7 ## 151 Adelie Biscoe 42.7 18.3 ## 152 Gentoo Biscoe 42.7 13.7 ## 153 Adelie Torgersen 42.8 18.5 ## 154 Gentoo Biscoe 42.8 14.2 ## 155 Adelie Torgersen 42.9 17.6 ## 156 Gentoo Biscoe 42.9 13.1 ## 157 Adelie Torgersen 43.1 19.2 ## 158 Adelie Dream 43.2 18.5 ## 159 Adelie Biscoe 43.2 19.0 ## 160 Gentoo Biscoe 43.2 14.5 ## 161 Chinstrap Dream 43.2 16.6 ## 162 Gentoo Biscoe 43.3 13.4 ## 163 Gentoo Biscoe 43.3 14.0 ## 164 Gentoo Biscoe 43.4 14.4 ## 165 Gentoo Biscoe 43.5 14.2 ## 166 Gentoo Biscoe 43.5 15.2 ## 167 Chinstrap Dream 43.5 18.1 ## 168 Gentoo Biscoe 43.6 13.9 ## 169 Gentoo Biscoe 43.8 13.9 ## 170 Gentoo Biscoe 44.0 13.6 ## 171 Adelie Dream 44.1 19.7 ## 172 Adelie Torgersen 44.1 18.0 ## 173 Gentoo Biscoe 44.4 17.3 ## 174 Gentoo Biscoe 44.5 14.3 ## 175 Gentoo Biscoe 44.5 14.7 ## 176 Gentoo Biscoe 44.5 15.7 ## 177 Gentoo Biscoe 44.9 13.3 ## 178 Gentoo Biscoe 44.9 13.8 ## 179 Gentoo Biscoe 45.0 15.4 ## 180 Gentoo Biscoe 45.1 14.5 ## 181 Gentoo Biscoe 45.1 14.5 ## 182 Gentoo Biscoe 45.1 14.4 ## 183 Gentoo Biscoe 45.2 15.8 ## 184 Gentoo Biscoe 45.2 13.8 ## 185 Gentoo Biscoe 45.2 16.4 ## 186 Gentoo Biscoe 45.2 14.8 ## 187 Chinstrap Dream 45.2 17.8 ## 188 Chinstrap Dream 45.2 16.6 ## 189 Gentoo Biscoe 45.3 13.7 ## 190 Gentoo Biscoe 45.3 13.8 ## 191 Gentoo Biscoe 45.4 14.6 ## 192 Chinstrap Dream 45.4 18.7 ## 193 Gentoo Biscoe 45.5 13.7 ## 194 Gentoo Biscoe 45.5 13.9 ## 195 Gentoo Biscoe 45.5 15.0 ## 196 Gentoo Biscoe 45.5 14.5 ## 197 Chinstrap Dream 45.5 17.0 ## 198 Adelie Biscoe 45.6 20.3 ## 199 Chinstrap Dream 45.6 19.4 ## 200 Gentoo Biscoe 45.7 13.9 ## 201 Chinstrap Dream 45.7 17.3 ## 202 Chinstrap Dream 45.7 17.0 ## 203 Adelie Torgersen 45.8 18.9 ## 204 Gentoo Biscoe 45.8 14.6 ## 205 Gentoo Biscoe 45.8 14.2 ## 206 Chinstrap Dream 45.9 17.1 ## 207 Adelie Torgersen 46.0 21.5 ## 208 Chinstrap Dream 46.0 18.9 ## 209 Gentoo Biscoe 46.1 13.2 ## 210 Gentoo Biscoe 46.1 15.1 ## 211 Chinstrap Dream 46.1 18.2 ## 212 Gentoo Biscoe 46.2 14.5 ## 213 Gentoo Biscoe 46.2 14.9 ## 214 Gentoo Biscoe 46.2 14.4 ## 215 Gentoo Biscoe 46.2 14.1 ## 216 Chinstrap Dream 46.2 17.5 ## 217 Gentoo Biscoe 46.3 15.8 ## 218 Gentoo Biscoe 46.4 15.6 ## 219 Gentoo Biscoe 46.4 15.0 ## 220 Chinstrap Dream 46.4 18.6 ## 221 Chinstrap Dream 46.4 17.8 ## 222 Gentoo Biscoe 46.5 13.5 ## 223 Gentoo Biscoe 46.5 14.5 ## 224 Gentoo Biscoe 46.5 14.4 ## 225 Gentoo Biscoe 46.5 14.8 ## 226 Chinstrap Dream 46.5 17.9 ## 227 Gentoo Biscoe 46.6 14.2 ## 228 Chinstrap Dream 46.6 17.8 ## 229 Gentoo Biscoe 46.7 15.3 ## 230 Chinstrap Dream 46.7 17.9 ## 231 Gentoo Biscoe 46.8 15.4 ## 232 Gentoo Biscoe 46.8 16.1 ## 233 Gentoo Biscoe 46.8 14.3 ## 234 Chinstrap Dream 46.8 16.5 ## 235 Gentoo Biscoe 46.9 14.6 ## 236 Chinstrap Dream 46.9 16.6 ## 237 Chinstrap Dream 47.0 17.3 ## 238 Gentoo Biscoe 47.2 15.5 ## 239 Gentoo Biscoe 47.2 13.7 ## 240 Gentoo Biscoe 47.3 15.3 ## 241 Gentoo Biscoe 47.3 13.8 ## 242 Gentoo Biscoe 47.4 14.6 ## 243 Gentoo Biscoe 47.5 14.2 ## 244 Gentoo Biscoe 47.5 14.0 ## 245 Gentoo Biscoe 47.5 15.0 ## 246 Chinstrap Dream 47.5 16.8 ## 247 Gentoo Biscoe 47.6 14.5 ## 248 Chinstrap Dream 47.6 18.3 ## 249 Gentoo Biscoe 47.7 15.0 ## 250 Gentoo Biscoe 47.8 15.0 ## 251 Gentoo Biscoe 48.1 15.1 ## 252 Chinstrap Dream 48.1 16.4 ## 253 Gentoo Biscoe 48.2 14.3 ## 254 Gentoo Biscoe 48.2 15.6 ## 255 Gentoo Biscoe 48.4 14.6 ## 256 Gentoo Biscoe 48.4 16.3 ## 257 Gentoo Biscoe 48.4 14.4 ## 258 Gentoo Biscoe 48.5 14.1 ## 259 Gentoo Biscoe 48.5 15.0 ## 260 Chinstrap Dream 48.5 17.5 ## 261 Gentoo Biscoe 48.6 16.0 ## 262 Gentoo Biscoe 48.7 14.1 ## 263 Gentoo Biscoe 48.7 15.1 ## 264 Gentoo Biscoe 48.7 15.7 ## 265 Gentoo Biscoe 48.8 16.2 ## 266 Gentoo Biscoe 49.0 16.1 ## 267 Chinstrap Dream 49.0 19.5 ## 268 Chinstrap Dream 49.0 19.6 ## 269 Gentoo Biscoe 49.1 14.8 ## 270 Gentoo Biscoe 49.1 14.5 ## 271 Gentoo Biscoe 49.1 15.0 ## 272 Gentoo Biscoe 49.2 15.2 ## 273 Chinstrap Dream 49.2 18.2 ## 274 Gentoo Biscoe 49.3 15.7 ## 275 Chinstrap Dream 49.3 19.9 ## 276 Gentoo Biscoe 49.4 15.8 ## 277 Gentoo Biscoe 49.5 16.2 ## 278 Gentoo Biscoe 49.5 16.1 ## 279 Chinstrap Dream 49.5 19.0 ## 280 Gentoo Biscoe 49.6 16.0 ## 281 Gentoo Biscoe 49.6 15.0 ## 282 Chinstrap Dream 49.6 18.2 ## 283 Chinstrap Dream 49.7 18.6 ## 284 Gentoo Biscoe 49.8 16.8 ## 285 Gentoo Biscoe 49.8 15.9 ## 286 Chinstrap Dream 49.8 17.3 ## 287 Gentoo Biscoe 49.9 16.1 ## 288 Gentoo Biscoe 50.0 16.3 ## 289 Gentoo Biscoe 50.0 15.2 ## 290 Gentoo Biscoe 50.0 15.3 ## 291 Gentoo Biscoe 50.0 15.9 ## 292 Chinstrap Dream 50.0 19.5 ## 293 Gentoo Biscoe 50.1 15.0 ## 294 Chinstrap Dream 50.1 17.9 ## 295 Gentoo Biscoe 50.2 14.3 ## 296 Chinstrap Dream 50.2 18.8 ## 297 Chinstrap Dream 50.2 18.7 ## 298 Chinstrap Dream 50.3 20.0 ## 299 Gentoo Biscoe 50.4 15.3 ## 300 Gentoo Biscoe 50.4 15.7 ## 301 Gentoo Biscoe 50.5 15.9 ## 302 Gentoo Biscoe 50.5 15.9 ## 303 Gentoo Biscoe 50.5 15.2 ## 304 Chinstrap Dream 50.5 19.6 ## 305 Chinstrap Dream 50.5 18.4 ## 306 Chinstrap Dream 50.6 19.4 ## 307 Gentoo Biscoe 50.7 15.0 ## 308 Chinstrap Dream 50.7 19.7 ## 309 Gentoo Biscoe 50.8 17.3 ## 310 Gentoo Biscoe 50.8 15.7 ## 311 Chinstrap Dream 50.8 18.5 ## 312 Chinstrap Dream 50.8 19.0 ## 313 Chinstrap Dream 50.9 19.1 ## 314 Chinstrap Dream 50.9 17.9 ## 315 Chinstrap Dream 51.0 18.8 ## 316 Gentoo Biscoe 51.1 16.3 ## 317 Gentoo Biscoe 51.1 16.5 ## 318 Gentoo Biscoe 51.3 14.2 ## 319 Chinstrap Dream 51.3 19.2 ## 320 Chinstrap Dream 51.3 18.2 ## 321 Chinstrap Dream 51.3 19.9 ## 322 Chinstrap Dream 51.4 19.0 ## 323 Gentoo Biscoe 51.5 16.3 ## 324 Chinstrap Dream 51.5 18.7 ## 325 Chinstrap Dream 51.7 20.3 ## 326 Chinstrap Dream 51.9 19.5 ## 327 Chinstrap Dream 52.0 18.1 ## 328 Chinstrap Dream 52.0 19.0 ## 329 Chinstrap Dream 52.0 20.7 ## 330 Gentoo Biscoe 52.1 17.0 ## 331 Gentoo Biscoe 52.2 17.1 ## 332 Chinstrap Dream 52.2 18.8 ## 333 Gentoo Biscoe 52.5 15.6 ## 334 Chinstrap Dream 52.7 19.8 ## 335 Chinstrap Dream 52.8 20.0 ## 336 Gentoo Biscoe 53.4 15.8 ## 337 Chinstrap Dream 53.5 19.9 ## 338 Chinstrap Dream 54.2 20.8 ## 339 Gentoo Biscoe 54.3 15.7 ## 340 Gentoo Biscoe 55.1 16.0 ## 341 Chinstrap Dream 55.8 19.8 ## 342 Gentoo Biscoe 55.9 17.0 ## 343 Chinstrap Dream 58.0 17.8 ## 344 Gentoo Biscoe 59.6 17.0 ``` --- # Order by clause ```sql SELECT species, island, bill_length_mm, bill_depth_mm FROM penguins ORDER BY bill_length_mm, bill_depth_mm ``` ``` ## species island bill_length_mm bill_depth_mm ## 1 Adelie Torgersen NA NA ## 2 Gentoo Biscoe NA NA ## 3 Adelie Dream 32.1 15.5 ## 4 Adelie Dream 33.1 16.1 ## 5 Adelie Torgersen 33.5 19.0 ## 6 Adelie Dream 34.0 17.1 ## 7 Adelie Torgersen 34.1 18.1 ## 8 Adelie Torgersen 34.4 18.4 ## 9 Adelie Biscoe 34.5 18.1 ## 10 Adelie Torgersen 34.6 17.2 ## 11 Adelie Torgersen 34.6 21.1 ## 12 Adelie Biscoe 35.0 17.9 ## 13 Adelie Biscoe 35.0 17.9 ## 14 Adelie Torgersen 35.1 19.4 ## 15 Adelie Torgersen 35.2 15.9 ## 16 Adelie Biscoe 35.3 18.9 ## 17 Adelie Biscoe 35.5 16.2 ## 18 Adelie Torgersen 35.5 17.5 ## 19 Adelie Dream 35.6 17.5 ## 20 Adelie Biscoe 35.7 16.9 ## 21 Adelie Torgersen 35.7 17.0 ## 22 Adelie Dream 35.7 18.0 ## 23 Adelie Torgersen 35.9 16.6 ## 24 Adelie Biscoe 35.9 19.2 ## 25 Adelie Dream 36.0 17.1 ## 26 Adelie Dream 36.0 17.8 ## 27 Adelie Dream 36.0 17.9 ## 28 Adelie Dream 36.0 18.5 ## 29 Adelie Torgersen 36.2 16.1 ## 30 Adelie Torgersen 36.2 17.2 ## 31 Adelie Dream 36.2 17.3 ## 32 Adelie Dream 36.3 19.5 ## 33 Adelie Dream 36.4 17.0 ## 34 Adelie Biscoe 36.4 17.1 ## 35 Adelie Biscoe 36.5 16.6 ## 36 Adelie Dream 36.5 18.0 ## 37 Adelie Torgersen 36.6 17.8 ## 38 Adelie Dream 36.6 18.4 ## 39 Adelie Torgersen 36.7 18.8 ## 40 Adelie Torgersen 36.7 19.3 ## 41 Adelie Dream 36.8 18.5 ## 42 Adelie Dream 36.9 18.6 ## 43 Adelie Dream 37.0 16.5 ## 44 Adelie Dream 37.0 16.9 ## 45 Adelie Dream 37.2 18.1 ## 46 Adelie Torgersen 37.2 19.4 ## 47 Adelie Dream 37.3 16.8 ## 48 Adelie Dream 37.3 17.8 ## 49 Adelie Torgersen 37.3 20.5 ## 50 Adelie Dream 37.5 18.5 ## 51 Adelie Dream 37.5 18.9 ## 52 Adelie Biscoe 37.6 17.0 ## 53 Adelie Biscoe 37.6 19.1 ## 54 Adelie Dream 37.6 19.3 ## 55 Adelie Biscoe 37.7 16.0 ## 56 Adelie Biscoe 37.7 18.7 ## 57 Adelie Torgersen 37.7 19.8 ## 58 Adelie Torgersen 37.8 17.1 ## 59 Adelie Torgersen 37.8 17.3 ## 60 Adelie Dream 37.8 18.1 ## 61 Adelie Biscoe 37.8 18.3 ## 62 Adelie Biscoe 37.8 20.0 ## 63 Adelie Biscoe 37.9 18.6 ## 64 Adelie Biscoe 37.9 18.6 ## 65 Adelie Biscoe 38.1 16.5 ## 66 Adelie Biscoe 38.1 17.0 ## 67 Adelie Dream 38.1 17.6 ## 68 Adelie Dream 38.1 18.6 ## 69 Adelie Biscoe 38.2 18.1 ## 70 Adelie Biscoe 38.2 20.0 ## 71 Adelie Dream 38.3 19.2 ## 72 Adelie Torgersen 38.5 17.9 ## 73 Adelie Torgersen 38.6 17.0 ## 74 Adelie Biscoe 38.6 17.2 ## 75 Adelie Torgersen 38.6 21.2 ## 76 Adelie Torgersen 38.7 19.0 ## 77 Adelie Biscoe 38.8 17.2 ## 78 Adelie Torgersen 38.8 17.6 ## 79 Adelie Dream 38.8 20.0 ## 80 Adelie Torgersen 38.9 17.8 ## 81 Adelie Dream 38.9 18.8 ## 82 Adelie Torgersen 39.0 17.1 ## 83 Adelie Biscoe 39.0 17.5 ## 84 Adelie Dream 39.0 18.7 ## 85 Adelie Torgersen 39.1 18.7 ## 86 Adelie Dream 39.2 18.6 ## 87 Adelie Torgersen 39.2 19.6 ## 88 Adelie Dream 39.2 21.1 ## 89 Adelie Torgersen 39.3 20.6 ## 90 Adelie Dream 39.5 16.7 ## 91 Adelie Torgersen 39.5 17.4 ## 92 Adelie Dream 39.5 17.8 ## 93 Adelie Torgersen 39.6 17.2 ## 94 Adelie Biscoe 39.6 17.7 ## 95 Adelie Dream 39.6 18.1 ## 96 Adelie Dream 39.6 18.8 ## 97 Adelie Biscoe 39.6 20.7 ## 98 Adelie Biscoe 39.7 17.7 ## 99 Adelie Dream 39.7 17.9 ## 100 Adelie Torgersen 39.7 18.4 ## 101 Adelie Biscoe 39.7 18.9 ## 102 Adelie Dream 39.8 19.1 ## 103 Adelie Biscoe 40.1 18.9 ## 104 Adelie Torgersen 40.2 17.0 ## 105 Adelie Dream 40.2 17.1 ## 106 Adelie Dream 40.2 20.1 ## 107 Adelie Torgersen 40.3 18.0 ## 108 Adelie Dream 40.3 18.5 ## 109 Adelie Biscoe 40.5 17.9 ## 110 Adelie Biscoe 40.5 18.9 ## 111 Adelie Dream 40.6 17.2 ## 112 Adelie Biscoe 40.6 18.6 ## 113 Adelie Biscoe 40.6 18.8 ## 114 Adelie Torgersen 40.6 19.0 ## 115 Adelie Dream 40.7 17.0 ## 116 Adelie Dream 40.8 18.4 ## 117 Adelie Dream 40.8 18.9 ## 118 Gentoo Biscoe 40.9 13.7 ## 119 Chinstrap Dream 40.9 16.6 ## 120 Adelie Torgersen 40.9 16.8 ## 121 Adelie Dream 40.9 18.9 ## 122 Adelie Biscoe 41.0 20.0 ## 123 Adelie Dream 41.1 17.5 ## 124 Adelie Torgersen 41.1 17.6 ## 125 Adelie Dream 41.1 18.1 ## 126 Adelie Biscoe 41.1 18.2 ## 127 Adelie Torgersen 41.1 18.6 ## 128 Adelie Dream 41.1 19.0 ## 129 Adelie Biscoe 41.1 19.1 ## 130 Adelie Dream 41.3 20.3 ## 131 Adelie Biscoe 41.3 21.1 ## 132 Adelie Torgersen 41.4 18.5 ## 133 Adelie Biscoe 41.4 18.6 ## 134 Adelie Torgersen 41.5 18.3 ## 135 Adelie Dream 41.5 18.5 ## 136 Adelie Biscoe 41.6 18.0 ## 137 Gentoo Biscoe 41.7 14.7 ## 138 Adelie Torgersen 41.8 19.4 ## 139 Gentoo Biscoe 42.0 13.5 ## 140 Adelie Biscoe 42.0 19.5 ## 141 Adelie Torgersen 42.0 20.2 ## 142 Adelie Torgersen 42.1 19.1 ## 143 Adelie Dream 42.2 18.5 ## 144 Adelie Biscoe 42.2 19.5 ## 145 Adelie Dream 42.3 21.2 ## 146 Chinstrap Dream 42.4 17.3 ## 147 Chinstrap Dream 42.5 16.7 ## 148 Chinstrap Dream 42.5 17.3 ## 149 Adelie Torgersen 42.5 20.7 ## 150 Gentoo Biscoe 42.6 13.7 ## 151 Gentoo Biscoe 42.7 13.7 ## 152 Adelie Biscoe 42.7 18.3 ## 153 Gentoo Biscoe 42.8 14.2 ## 154 Adelie Torgersen 42.8 18.5 ## 155 Gentoo Biscoe 42.9 13.1 ## 156 Adelie Torgersen 42.9 17.6 ## 157 Adelie Torgersen 43.1 19.2 ## 158 Gentoo Biscoe 43.2 14.5 ## 159 Chinstrap Dream 43.2 16.6 ## 160 Adelie Dream 43.2 18.5 ## 161 Adelie Biscoe 43.2 19.0 ## 162 Gentoo Biscoe 43.3 13.4 ## 163 Gentoo Biscoe 43.3 14.0 ## 164 Gentoo Biscoe 43.4 14.4 ## 165 Gentoo Biscoe 43.5 14.2 ## 166 Gentoo Biscoe 43.5 15.2 ## 167 Chinstrap Dream 43.5 18.1 ## 168 Gentoo Biscoe 43.6 13.9 ## 169 Gentoo Biscoe 43.8 13.9 ## 170 Gentoo Biscoe 44.0 13.6 ## 171 Adelie Torgersen 44.1 18.0 ## 172 Adelie Dream 44.1 19.7 ## 173 Gentoo Biscoe 44.4 17.3 ## 174 Gentoo Biscoe 44.5 14.3 ## 175 Gentoo Biscoe 44.5 14.7 ## 176 Gentoo Biscoe 44.5 15.7 ## 177 Gentoo Biscoe 44.9 13.3 ## 178 Gentoo Biscoe 44.9 13.8 ## 179 Gentoo Biscoe 45.0 15.4 ## 180 Gentoo Biscoe 45.1 14.4 ## 181 Gentoo Biscoe 45.1 14.5 ## 182 Gentoo Biscoe 45.1 14.5 ## 183 Gentoo Biscoe 45.2 13.8 ## 184 Gentoo Biscoe 45.2 14.8 ## 185 Gentoo Biscoe 45.2 15.8 ## 186 Gentoo Biscoe 45.2 16.4 ## 187 Chinstrap Dream 45.2 16.6 ## 188 Chinstrap Dream 45.2 17.8 ## 189 Gentoo Biscoe 45.3 13.7 ## 190 Gentoo Biscoe 45.3 13.8 ## 191 Gentoo Biscoe 45.4 14.6 ## 192 Chinstrap Dream 45.4 18.7 ## 193 Gentoo Biscoe 45.5 13.7 ## 194 Gentoo Biscoe 45.5 13.9 ## 195 Gentoo Biscoe 45.5 14.5 ## 196 Gentoo Biscoe 45.5 15.0 ## 197 Chinstrap Dream 45.5 17.0 ## 198 Chinstrap Dream 45.6 19.4 ## 199 Adelie Biscoe 45.6 20.3 ## 200 Gentoo Biscoe 45.7 13.9 ## 201 Chinstrap Dream 45.7 17.0 ## 202 Chinstrap Dream 45.7 17.3 ## 203 Gentoo Biscoe 45.8 14.2 ## 204 Gentoo Biscoe 45.8 14.6 ## 205 Adelie Torgersen 45.8 18.9 ## 206 Chinstrap Dream 45.9 17.1 ## 207 Chinstrap Dream 46.0 18.9 ## 208 Adelie Torgersen 46.0 21.5 ## 209 Gentoo Biscoe 46.1 13.2 ## 210 Gentoo Biscoe 46.1 15.1 ## 211 Chinstrap Dream 46.1 18.2 ## 212 Gentoo Biscoe 46.2 14.1 ## 213 Gentoo Biscoe 46.2 14.4 ## 214 Gentoo Biscoe 46.2 14.5 ## 215 Gentoo Biscoe 46.2 14.9 ## 216 Chinstrap Dream 46.2 17.5 ## 217 Gentoo Biscoe 46.3 15.8 ## 218 Gentoo Biscoe 46.4 15.0 ## 219 Gentoo Biscoe 46.4 15.6 ## 220 Chinstrap Dream 46.4 17.8 ## 221 Chinstrap Dream 46.4 18.6 ## 222 Gentoo Biscoe 46.5 13.5 ## 223 Gentoo Biscoe 46.5 14.4 ## 224 Gentoo Biscoe 46.5 14.5 ## 225 Gentoo Biscoe 46.5 14.8 ## 226 Chinstrap Dream 46.5 17.9 ## 227 Gentoo Biscoe 46.6 14.2 ## 228 Chinstrap Dream 46.6 17.8 ## 229 Gentoo Biscoe 46.7 15.3 ## 230 Chinstrap Dream 46.7 17.9 ## 231 Gentoo Biscoe 46.8 14.3 ## 232 Gentoo Biscoe 46.8 15.4 ## 233 Gentoo Biscoe 46.8 16.1 ## 234 Chinstrap Dream 46.8 16.5 ## 235 Gentoo Biscoe 46.9 14.6 ## 236 Chinstrap Dream 46.9 16.6 ## 237 Chinstrap Dream 47.0 17.3 ## 238 Gentoo Biscoe 47.2 13.7 ## 239 Gentoo Biscoe 47.2 15.5 ## 240 Gentoo Biscoe 47.3 13.8 ## 241 Gentoo Biscoe 47.3 15.3 ## 242 Gentoo Biscoe 47.4 14.6 ## 243 Gentoo Biscoe 47.5 14.0 ## 244 Gentoo Biscoe 47.5 14.2 ## 245 Gentoo Biscoe 47.5 15.0 ## 246 Chinstrap Dream 47.5 16.8 ## 247 Gentoo Biscoe 47.6 14.5 ## 248 Chinstrap Dream 47.6 18.3 ## 249 Gentoo Biscoe 47.7 15.0 ## 250 Gentoo Biscoe 47.8 15.0 ## 251 Gentoo Biscoe 48.1 15.1 ## 252 Chinstrap Dream 48.1 16.4 ## 253 Gentoo Biscoe 48.2 14.3 ## 254 Gentoo Biscoe 48.2 15.6 ## 255 Gentoo Biscoe 48.4 14.4 ## 256 Gentoo Biscoe 48.4 14.6 ## 257 Gentoo Biscoe 48.4 16.3 ## 258 Gentoo Biscoe 48.5 14.1 ## 259 Gentoo Biscoe 48.5 15.0 ## 260 Chinstrap Dream 48.5 17.5 ## 261 Gentoo Biscoe 48.6 16.0 ## 262 Gentoo Biscoe 48.7 14.1 ## 263 Gentoo Biscoe 48.7 15.1 ## 264 Gentoo Biscoe 48.7 15.7 ## 265 Gentoo Biscoe 48.8 16.2 ## 266 Gentoo Biscoe 49.0 16.1 ## 267 Chinstrap Dream 49.0 19.5 ## 268 Chinstrap Dream 49.0 19.6 ## 269 Gentoo Biscoe 49.1 14.5 ## 270 Gentoo Biscoe 49.1 14.8 ## 271 Gentoo Biscoe 49.1 15.0 ## 272 Gentoo Biscoe 49.2 15.2 ## 273 Chinstrap Dream 49.2 18.2 ## 274 Gentoo Biscoe 49.3 15.7 ## 275 Chinstrap Dream 49.3 19.9 ## 276 Gentoo Biscoe 49.4 15.8 ## 277 Gentoo Biscoe 49.5 16.1 ## 278 Gentoo Biscoe 49.5 16.2 ## 279 Chinstrap Dream 49.5 19.0 ## 280 Gentoo Biscoe 49.6 15.0 ## 281 Gentoo Biscoe 49.6 16.0 ## 282 Chinstrap Dream 49.6 18.2 ## 283 Chinstrap Dream 49.7 18.6 ## 284 Gentoo Biscoe 49.8 15.9 ## 285 Gentoo Biscoe 49.8 16.8 ## 286 Chinstrap Dream 49.8 17.3 ## 287 Gentoo Biscoe 49.9 16.1 ## 288 Gentoo Biscoe 50.0 15.2 ## 289 Gentoo Biscoe 50.0 15.3 ## 290 Gentoo Biscoe 50.0 15.9 ## 291 Gentoo Biscoe 50.0 16.3 ## 292 Chinstrap Dream 50.0 19.5 ## 293 Gentoo Biscoe 50.1 15.0 ## 294 Chinstrap Dream 50.1 17.9 ## 295 Gentoo Biscoe 50.2 14.3 ## 296 Chinstrap Dream 50.2 18.7 ## 297 Chinstrap Dream 50.2 18.8 ## 298 Chinstrap Dream 50.3 20.0 ## 299 Gentoo Biscoe 50.4 15.3 ## 300 Gentoo Biscoe 50.4 15.7 ## 301 Gentoo Biscoe 50.5 15.2 ## 302 Gentoo Biscoe 50.5 15.9 ## 303 Gentoo Biscoe 50.5 15.9 ## 304 Chinstrap Dream 50.5 18.4 ## 305 Chinstrap Dream 50.5 19.6 ## 306 Chinstrap Dream 50.6 19.4 ## 307 Gentoo Biscoe 50.7 15.0 ## 308 Chinstrap Dream 50.7 19.7 ## 309 Gentoo Biscoe 50.8 15.7 ## 310 Gentoo Biscoe 50.8 17.3 ## 311 Chinstrap Dream 50.8 18.5 ## 312 Chinstrap Dream 50.8 19.0 ## 313 Chinstrap Dream 50.9 17.9 ## 314 Chinstrap Dream 50.9 19.1 ## 315 Chinstrap Dream 51.0 18.8 ## 316 Gentoo Biscoe 51.1 16.3 ## 317 Gentoo Biscoe 51.1 16.5 ## 318 Gentoo Biscoe 51.3 14.2 ## 319 Chinstrap Dream 51.3 18.2 ## 320 Chinstrap Dream 51.3 19.2 ## 321 Chinstrap Dream 51.3 19.9 ## 322 Chinstrap Dream 51.4 19.0 ## 323 Gentoo Biscoe 51.5 16.3 ## 324 Chinstrap Dream 51.5 18.7 ## 325 Chinstrap Dream 51.7 20.3 ## 326 Chinstrap Dream 51.9 19.5 ## 327 Chinstrap Dream 52.0 18.1 ## 328 Chinstrap Dream 52.0 19.0 ## 329 Chinstrap Dream 52.0 20.7 ## 330 Gentoo Biscoe 52.1 17.0 ## 331 Gentoo Biscoe 52.2 17.1 ## 332 Chinstrap Dream 52.2 18.8 ## 333 Gentoo Biscoe 52.5 15.6 ## 334 Chinstrap Dream 52.7 19.8 ## 335 Chinstrap Dream 52.8 20.0 ## 336 Gentoo Biscoe 53.4 15.8 ## 337 Chinstrap Dream 53.5 19.9 ## 338 Chinstrap Dream 54.2 20.8 ## 339 Gentoo Biscoe 54.3 15.7 ## 340 Gentoo Biscoe 55.1 16.0 ## 341 Chinstrap Dream 55.8 19.8 ## 342 Gentoo Biscoe 55.9 17.0 ## 343 Chinstrap Dream 58.0 17.8 ## 344 Gentoo Biscoe 59.6 17.0 ``` --- # group by clause ```sql SELECT AVG(bill_length_mm) AS avg_bill_length, AVG(bill_depth_mm) AS avg_bill_depth FROM penguins ``` ``` ## avg_bill_length avg_bill_depth ## 1 43.92193 17.15117 ``` --- # group by clause ```sql SELECT island, AVG(bill_length_mm) AS avg_bill_length, AVG(bill_depth_mm) AS avg_bill_depth FROM penguins GROUP BY island ``` ``` ## island avg_bill_length avg_bill_depth ## 1 Biscoe 45.25749 15.87485 ## 2 Dream 44.16774 18.34435 ## 3 Torgersen 38.95098 18.42941 ``` --- # group by clause ```sql SELECT island, species, AVG(bill_length_mm) AS avg_bill_length, AVG(bill_depth_mm) AS avg_bill_depth FROM penguins GROUP BY island, species ``` ``` ## island species avg_bill_length avg_bill_depth ## 1 Biscoe Adelie 38.97500 18.37045 ## 2 Biscoe Gentoo 47.50488 14.98211 ## 3 Dream Adelie 38.50179 18.25179 ## 4 Dream Chinstrap 48.83382 18.42059 ## 5 Torgersen Adelie 38.95098 18.42941 ``` --- # group by clause - count ```sql SELECT island, species, COUNT(*) AS count FROM penguins GROUP BY island, species ``` ``` ## island species count ## 1 Biscoe Adelie 44 ## 2 Biscoe Gentoo 124 ## 3 Dream Adelie 56 ## 4 Dream Chinstrap 68 ## 5 Torgersen Adelie 52 ``` --- # group by clause - count ```sql SELECT island, species, COUNT(*) AS count FROM penguins GROUP BY island, species HAVING COUNT(*) < 100 ``` ``` ## island species count ## 1 Biscoe Adelie 44 ## 2 Dream Adelie 56 ## 3 Dream Chinstrap 68 ## 4 Torgersen Adelie 52 ``` --- # SQL Joins How do we use multiple tables in a single query? Using JOINs clauses: <div style="font-size: 14pt"> <ul> <li><code>(INNER) JOIN</code>: Returns records that have matching values in both tables</li> <li><code>LEFT (OUTER)</code> JOIN: Returns all records from the left table, and the matched records from the right table</li> <li><code>RIGHT (OUTER)</code> JOIN: Returns all records from the right table, and the matched records from the left table</li> <li><code>FULL (OUTER)</code> JOIN: Returns all records when there is a match in either left or right table</li> </ul> </div> To learn more about joins (and practice), checkout the [W3Schools website](https://www.w3schools.com/sql/sql_join.asp). --- # SQL Joins (cont. 1) - <img src="https://www.w3schools.com/sql/img_innerjoin.gif"> ```r merge(x, y, all.x = FALSE, all.y = FALSE) ``` - <img src="https://www.w3schools.com/sql/img_leftjoin.gif"> ```r merge(x, y, all.x = TRUE, all.y = FALSE) ``` --- # SQL Joins (cont. 2) - <img src="https://www.w3schools.com/sql/img_rightjoin.gif"> ```r merge(x, y, all.x = FALSE, all.y = TRUE) ``` - <img src="https://www.w3schools.com/sql/img_fulljoin.gif"> ```r merge(x, y, all.x = TRUE, all.y = TRUE) ``` --- # SQL Joins with CHS Data We first start by loading the datasets from https://github.com/USCBiostats/data-science-data ```r # Download chs_regional <- read.csv("https://github.com/USCbiostats/data-science-data/raw/master/01_chs/chs_regional.csv") chs_individual <- read.csv("https://github.com/USCbiostats/data-science-data/raw/master/01_chs/chs_individual.csv") # Dropping some regions chs_regional <- subset(chs_regional, !townname %in% c("Alpine", "Lompoc")) chs_individual <- subset(chs_individual, townname != "Lancaster") ``` --- ```r # Set the dataset con <- dbConnect(SQLite(), ":memory:") dbWriteTable(con, "regional", chs_regional) dbWriteTable(con, "individual", chs_individual) ``` We now can illustrate the joins --- ## SQL **INNER join** <img src="https://www.w3schools.com/sql/img_innerjoin.gif" width="15%"> - `chs_individual` has 1100 rows - `chs_regional` has 10 rows ```r ans <- dbGetQuery(con, "SELECT * FROM regional AS a INNER JOIN individual AS b ON a.townname = b.townname ") nrow(ans) ``` ``` ## [1] 900 ``` --- ## SQL **LEFT join** <img src="https://www.w3schools.com/sql/img_leftjoin.gif" width="15%"> - `chs_individual` has 1100 rows - `chs_regional` has 10 rows ```r ans <- dbGetQuery(con, "SELECT * FROM regional AS a LEFT JOIN individual AS b ON a.townname = b.townname") nrow(ans) ``` ``` ## [1] 901 ``` --- ## SQL **RIGHT join** <img src="https://www.w3schools.com/sql/img_rightjoin.gif" width="15%"> - `chs_individual` has 1100 rows - `chs_regional` has 10 rows ```r ans <- dbGetQuery(con, "SELECT * /* RIGHT joins are not supported by SQLite*/ FROM individual AS a LEFT JOIN regional AS b ON a.townname = b.townname") nrow(ans) ``` ``` ## [1] 1100 ``` --- ## SQL **FULL join** <img src="https://www.w3schools.com/sql/img_fulljoin.gif" width="15%"> - `chs_individual` has 1100 rows - `chs_regional` has 10 rows ```r ans <- dbGetQuery(con, "SELECT * FROM individual AS a FULL JOIN regional AS b ON a.townname = b.townname") nrow(ans) ``` You would get an error: "RIGHT and FULL OUTER JOINS are not currently supported Execution halted" --- ## SQL **FULL join** (cont.) <img src="https://www.w3schools.com/sql/img_fulljoin.gif" width="15%"> - `chs_individual` has 1100 rows - `chs_regional` has 10 rows ```r ans <- dbGetQuery(con, "SELECT * FROM individual AS a LEFT JOIN regional AS b ON a.townname = b.townname UNION SELECT * FROM regional AS a LEFT JOIN individual AS b ON a.townname = b.townname ") nrow(ans) ``` ``` ## [1] 2001 ``` ```r dbDisconnect(con) ``` --- ## What happens when there are no records matching Step 1: Let's break things ```r chs_individual2 <- subset( chs_individual, !(townname %in% chs_regional$townname) ) unique(chs_individual2$townname) ``` ``` ## [1] "Alpine" "Lompoc" ``` ```r chs_regional$townname ``` ``` ## [1] "Lake Elsinore" "Lake Gregory" "Lancaster" "Long Beach" ## [5] "Mira Loma" "Riverside" "San Dimas" "Atascadero" ## [9] "Santa Maria" "Upland" ``` --- Step 2: Rebuild the Database ```r con <- dbConnect(SQLite(), ":memory:") dbWriteTable(con, "regional", chs_regional) dbWriteTable(con, "individual", chs_individual2) ``` What happens now? --- Re-running the full join, - `chs_individual` has 200 rows - `chs_regional` has 10 rows ```r ans <- dbGetQuery(con, "SELECT * FROM individual AS a LEFT JOIN regional AS b ON a.townname = b.townname UNION SELECT * FROM regional AS a LEFT JOIN individual AS b ON a.townname = b.townname ") nrow(ans) ``` ``` ## [1] 210 ``` ```r dbDisconnect(con) ``` --- What happens when we have multiple matching records in both tables? ```r con <- dbConnect(SQLite(), ":memory:") dbWriteTable(con, "regional_dpl", rbind(chs_regional, chs_regional)) nrow(rbind(chs_regional, chs_regional)) ``` ``` ## [1] 20 ``` ```r ans <- dbGetQuery(con, "SELECT * FROM regional_dpl AS a LEFT JOIN regional_dpl AS b ON a.townname = b.townname UNION SELECT * FROM regional_dpl AS a LEFT JOIN regional_dpl AS b ON a.townname = b.townname ") nrow(ans) ``` ``` ## [1] 10 ``` --- ```r ans <- dbGetQuery(con, "SELECT * FROM regional_dpl AS a INNER JOIN regional_dpl AS b ON a.townname = b.townname ") nrow(ans) ``` ``` ## [1] 40 ``` ```r dbDisconnect(con) ```