SQL Atomic Number Symbol 1 H 2 He
SQL
Atomic Number Symbol 1 H 2 He 3 Li 4 Be 5 B 6 C 7 N 8 O 9 F 10 Ne 11 Na 12 Mg 13 Al 14 Si 15 P 16 S 17 Cl 18 Ar 19 K 20 Ca Name Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulphur Chlorine Argon Potassium Calcium Boiling Point State Atomic Mass Melting Point 1. 0 -259. 1 -252. 9 Gas 4. 0 -272. 2 -268. 9 Gas 7. 0 180. 5 1342 Solid 9. 0 1278 2970 Solid 10. 8 2079 2550 Solid 12. 0 3367 4827 Solid 14. 0 -209. 9 -195. 8 Gas 16. 0 -218. 4 -183 Gas 19. 0 -219. 8 -188. 1 Gas 20. 2 -248. 7 Gas 23. 0 97. 8 883 Solid 24. 3 649 1090 Solid 27. 0 660 2467 Solid 28. 1 1410 2355 Solid 31. 0 44. 1 280 Solid 32. 1 112. 8 444. 7 Solid 35. 5 -101 -34. 6 Gas 39. 9 -189. 2 -185. 7 Gas 39. 1 63. 25 760 Solid 40. 1 839 1484 Solid Type Non-metal Metal Metalloid Non-metal Non-metal Metal 1. How many records would be found if you used the query: a) SELECT Name from Elements WHERE Type=Metal b) SELECT * from Elements WHERE State=Gas c) SELECT Name from Elements WHERE Type=Metal AND State=Gas d) SELECT Name from Elements WHERE Atomic Mass>20 AND Type=Metal e) SELECT Name from Elements WHERE Atomic Mass<20 AND Atomic Number>5 This is a database table called Elements Ans 1 a) 1 b) 1 c) 1 d) 1 e)
Atomic Number Symbol 1 H 2 He 3 Li 4 Be 5 B 6 C 7 N 8 O 9 F 10 Ne 11 Na 12 Mg 13 Al 14 Si 15 P 16 S 17 Cl 18 Ar 19 K 20 Ca Name Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulphur Chlorine Argon Potassium Calcium Boiling Point State Atomic Mass Melting Point 1. 0 -259. 1 -252. 9 Gas 4. 0 -272. 2 -268. 9 Gas 7. 0 180. 5 1342 Solid 9. 0 1278 2970 Solid 10. 8 2079 2550 Solid 12. 0 3367 4827 Solid 14. 0 -209. 9 -195. 8 Gas 16. 0 -218. 4 -183 Gas 19. 0 -219. 8 -188. 1 Gas 20. 2 -248. 7 Gas 23. 0 97. 8 883 Solid 24. 3 649 1090 Solid 27. 0 660 2467 Solid 28. 1 1410 2355 Solid 31. 0 44. 1 280 Solid 32. 1 112. 8 444. 7 Solid 35. 5 -101 -34. 6 Gas 39. 9 -189. 2 -185. 7 Gas 39. 1 63. 25 760 Solid 40. 1 839 1484 Solid Type Non-metal Metal Metalloid Non-metal Non-metal Metal 2. What would be listed if you used the query: a) SELECT Symbol from Elements WHERE State=Gas b) SELECT Symbol from Elements WHERE Type=Metalloid c) SELECT Symbol from Elements WHERE Melting Point>1000 d) SELECT Name from Elements WHERE Atomic Mass<10 AND Type=Metal e) SELECT Name from Elements WHERE Atomic Mass<20 AND State=Solid This is a database table called Elements Ans 2 a) H; He; N; O; F; Ne; Cl; Ar 2 b) 2 c) 2 d) 2 e)
Atomic Number Symbol 1 H 2 He 3 Li 4 Be 5 B 6 C 7 N 8 O 9 F 10 Ne 11 Na 12 Mg 13 Al 14 Si 15 P 16 S 17 Cl 18 Ar 19 K 20 Ca Name Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulphur Chlorine Argon Potassium Calcium Boiling Point State Atomic Mass Melting Point 1. 0 -259. 1 -252. 9 Gas 4. 0 -272. 2 -268. 9 Gas 7. 0 180. 5 1342 Solid 9. 0 1278 2970 Solid 10. 8 2079 2550 Solid 12. 0 3367 4827 Solid 14. 0 -209. 9 -195. 8 Gas 16. 0 -218. 4 -183 Gas 19. 0 -219. 8 -188. 1 Gas 20. 2 -248. 7 Gas 23. 0 97. 8 883 Solid 24. 3 649 1090 Solid 27. 0 660 2467 Solid 28. 1 1410 2355 Solid 31. 0 44. 1 280 Solid 32. 1 112. 8 444. 7 Solid 35. 5 -101 -34. 6 Gas 39. 9 -189. 2 -185. 7 Gas 39. 1 63. 25 760 Solid 40. 1 839 1484 Solid Type Non-metal Metal Metalloid Non-metal Non-metal Metal This is a database table called Elements Ans 3 a) 1, Hydrogen; 2, Helium 3 b) 3 c) 3 d) 3 e) 3. What would be listed if you used the query: a) SELECT Atomic Number, Name from Elements WHERE Atomic Mass < 7 b) SELECT Atomic Number, Symbol from Elements WHERE Type=Metal AND Atomic Mass > 30 c) SELECT Symbol, Atomic Mass from Elements WHERE Melting Point < -200 d) SELECT Name from Elements WHERE Type=Metal OR Atomic Number < 3 e) SELECT Symbol from Elements WHERE Atomic Mass < 10 OR Atomic Mass > 35
Atomic Number Symbol 1 H 2 He 3 Li 4 Be 5 B 6 C 7 N 8 O 9 F 10 Ne 11 Na 12 Mg 13 Al 14 Si 15 P 16 S 17 Cl 18 Ar 19 K 20 Ca Name Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulphur Chlorine Argon Potassium Calcium Boiling Point State Atomic Mass Melting Point 1. 0 -259. 1 -252. 9 Gas 4. 0 -272. 2 -268. 9 Gas 7. 0 180. 5 1342 Solid 9. 0 1278 2970 Solid 10. 8 2079 2550 Solid 12. 0 3367 4827 Solid 14. 0 -209. 9 -195. 8 Gas 16. 0 -218. 4 -183 Gas 19. 0 -219. 8 -188. 1 Gas 20. 2 -248. 7 Gas 23. 0 97. 8 883 Solid 24. 3 649 1090 Solid 27. 0 660 2467 Solid 28. 1 1410 2355 Solid 31. 0 44. 1 280 Solid 32. 1 112. 8 444. 7 Solid 35. 5 -101 -34. 6 Gas 39. 9 -189. 2 -185. 7 Gas 39. 1 63. 25 760 Solid 40. 1 839 1484 Solid Type Non-metal Metal Metalloid Non-metal Non-metal Metal This is a database table called Elements 4. a) Write a query to list the names of all of the elements that are a gas: b) Write a query to list all of the information about all of the elements that are a Metal:
Atomic Number Symbol 1 H 2 He 3 Li 4 Be 5 B 6 C 7 N 8 O 9 F 10 Ne 11 Na 12 Mg 13 Al 14 Si 15 P 16 S 17 Cl 18 Ar 19 K 20 Ca Name Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulphur Chlorine Argon Potassium Calcium Boiling Point State Atomic Mass Melting Point 1. 0 -259. 1 -252. 9 Gas 4. 0 -272. 2 -268. 9 Gas 7. 0 180. 5 1342 Solid 9. 0 1278 2970 Solid 10. 8 2079 2550 Solid 12. 0 3367 4827 Solid 14. 0 -209. 9 -195. 8 Gas 16. 0 -218. 4 -183 Gas 19. 0 -219. 8 -188. 1 Gas 20. 2 -248. 7 Gas 23. 0 97. 8 883 Solid 24. 3 649 1090 Solid 27. 0 660 2467 Solid 28. 1 1410 2355 Solid 31. 0 44. 1 280 Solid 32. 1 112. 8 444. 7 Solid 35. 5 -101 -34. 6 Gas 39. 9 -189. 2 -185. 7 Gas 39. 1 63. 25 760 Solid 40. 1 839 1484 Solid Type Non-metal Metal Metalloid Non-metal Non-metal Metal This is a database table called Elements 5. a) Write a query to list the names of all of the elements that are either a gas or a metalloid: b) Write a query to list all of the information about all of the elements that have an Atomic Mass of greater than 21:
Atomic Number Symbol 1 H 2 He 3 Li 4 Be 5 B 6 C 7 N 8 O 9 F 10 Ne 11 Na 12 Mg 13 Al 14 Si 15 P 16 S 17 Cl 18 Ar 19 K 20 Ca Name Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulphur Chlorine Argon Potassium Calcium Boiling Point State Atomic Mass Melting Point 1. 0 -259. 1 -252. 9 Gas 4. 0 -272. 2 -268. 9 Gas 7. 0 180. 5 1342 Solid 9. 0 1278 2970 Solid 10. 8 2079 2550 Solid 12. 0 3367 4827 Solid 14. 0 -209. 9 -195. 8 Gas 16. 0 -218. 4 -183 Gas 19. 0 -219. 8 -188. 1 Gas 20. 2 -248. 7 Gas 23. 0 97. 8 883 Solid 24. 3 649 1090 Solid 27. 0 660 2467 Solid 28. 1 1410 2355 Solid 31. 0 44. 1 280 Solid 32. 1 112. 8 444. 7 Solid 35. 5 -101 -34. 6 Gas 39. 9 -189. 2 -185. 7 Gas 39. 1 63. 25 760 Solid 40. 1 839 1484 Solid Type Non-metal Metal Metalloid Non-metal Non-metal Metal This is a database table called Elements 6. a) Write a query to list the names and Atomic Mass of all of the elements that have either a melting point less than 0 or are a gas b) Write a query to list all of the information about all of the elements that are metals with an atomic number less than 10
Atomic Number Symbol 1 H 2 He 3 Li 4 Be 5 B 6 C 7 N 8 O 9 F 10 Ne 11 Na 12 Mg 13 Al 14 Si 15 P 16 S 17 Cl 18 Ar 19 K 20 Ca Name Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulphur Chlorine Argon Potassium Calcium Boiling Point State Atomic Mass Melting Point 1. 0 -259. 1 -252. 9 Gas 4. 0 -272. 2 -268. 9 Gas 7. 0 180. 5 1342 Solid 9. 0 1278 2970 Solid 10. 8 2079 2550 Solid 12. 0 3367 4827 Solid 14. 0 -209. 9 -195. 8 Gas 16. 0 -218. 4 -183 Gas 19. 0 -219. 8 -188. 1 Gas 20. 2 -248. 7 Gas 23. 0 97. 8 883 Solid 24. 3 649 1090 Solid 27. 0 660 2467 Solid 28. 1 1410 2355 Solid 31. 0 44. 1 280 Solid 32. 1 112. 8 444. 7 Solid 35. 5 -101 -34. 6 Gas 39. 9 -189. 2 -185. 7 Gas 39. 1 63. 25 760 Solid 40. 1 839 1484 Solid Type Non-metal Metal Metalloid Non-metal Non-metal Metal This is a database table called Elements 7. a) Find out how to write a query that would list all of the elements whose name started with the letter C b) Find out how to write a query that would list all of the elements whose name ended with the letter m c) Find out how to write a query that would list all of the elements whose name contains the letter n
Go to the website: https: //www. w 3 schools. com/sql/trysql. asp? filename=trysql_select_where_number And try using some SQL statements
- Slides: 9