SQL69 SQL Basics - Position You have access to a table of monsters as follows: monsters schema id name legs arms characteristics In each row, the characteristic column has a single comma. Your job is to find it using position(). You must return a table with the format as follows: output schema id name comma The comma column will contain the position of the comma within the characteristics string. Order the results by comma.. 2022. 6. 6. Register for the Party (SQL for Beginners #3) You received an invitation to an amazing party. Now you need to write an insert statement to add yourself to the table of participants. participants table schema name (string) age (integer) attending (boolean) NOTES: Since alcohol will be served, you can only attend if you are 21 or older You can't attend if the attending column returns anything but true NOTE: Your solution should use pure SQL. .. 2022. 6. 5. SQL Grasshopper: Select Columns #Greetings Grasshopper!# Using only SQL, write a query that returns all rows in the custid, custname, and custstate columns from the customers table. ###Table Description for customers:### ColumnData TypeSizeSample custid integer 8 4 custname string 50 Anakin Skywalker custstate string 50 Tatooine custard string 50 R2-D2 Solution: SELECT custid, custname, custstate FROM customers 2022. 6. 5. Remove String Spaces Simple, remove the spaces from the string, then return the resultant string. Solution: SELECT x, REPLACE(x, ' ', '') AS res FROM nospace Result: x res 8 j 8 mBliB8g imjB8B8 jl B 8j8mBliB8gimjB8B8jlB 8 8 Bi fk8h B 8 BB8B B B B888 c hl8 BhB fd 88Bifk8hB8BB8BBBB888chl8BhBfd 8aaaaa dddd r 8aaaaaddddr jfBm gk lf8hg 88lbe8 jfBmgklf8hg88lbe8 2022. 6. 4. On the Canadian Border (SQL for Beginners #2) You are a border guard sitting on the Canadian border. You were given a list of travelers who have arrived at your gate today. You know that American, Mexican, and Canadian citizens don't need visas, so they can just continue their trips. You don't need to check their passports for visas! You only need to check the passports of citizens of all other countries! Select names, and countries of orig.. 2022. 6. 2. Easy SQL: Bit Length Given a demographics table in the following format: ** demographics table schema ** id name birthday race you need to return the same table where all text fields (name & race) are changed to the bit length of the string. Solution: SELECT id, BIT_LENGTH(name) AS name, birthday, BIT_LENGTH(race) AS race FROM demographics Result: id name birthday race 1 40 1983-01-30 200 2 40 1974-09-15 200 3 40 19.. 2022. 6. 2. 이전 1 ··· 5 6 7 8 9 10 11 12 다음