> ## Content Index
> Fetch the complete content index at: https://www.bramadams.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# Real Data Science SQL Interview Questions and Answers # 1 | Data Science Interview Questions - YouTube
- URL: https://www.bramadams.dev/202301091700/
- Published: 2023-01-28T02:32:58.000Z
- Updated: 2023-01-28T02:32:58.000Z
- Author: Bram Adams
- Tags: sql, youtube-notes

```timestamp-url
 https://www.youtube.com/watch?v=Td-cmLfQ7uU&ab_channel=TinaHuang

```

```timestamp
 01:40

```

building a potential and reasonable schema

```timestamp
 02:28

```

`--` is a comment in SQL

```timestamp
 03:06

```

`FROM` \-> `JOIN` \-> `ON` … `AND`

```timestamp
 04:21

```

line 13: build a function by using `SELECT`

```timestamp
 04:34

```

`COUNT (DISTINCT …)`

![https://bram-adams.ghost.io/content/images/2023/01/sql-date-trunc-tina.png](https://storage.ghost.io/c/0c/cc/0ccc9a8d-054a-4056-b11e-e1bfbbb66387/content/images/2023/01/sql-date-trunc-tina.png)

sql date trunc tina.png

1. joining all iOS and web users by ID
2. func `DATE_TRUNC`
3. `num_users` \= distinct count by 'day'
4. group the result into `num_users` and `day`

![https://bram-adams.ghost.io/content/images/2023/01/real-data-sci-sql-interview-tina-huang-Screenshot-2023-01-09-17-15-59.png](https://storage.ghost.io/c/0c/cc/0ccc9a8d-054a-4056-b11e-e1bfbbb66387/content/images/2023/01/real-data-sci-sql-interview-tina-huang-Screenshot-2023-01-09-17-15-59.png)

real data sci sql interview tina huang Screenshot 2023-01-09 17-15-59.png

`CREATE TABLE`

`INSERT INTO`  
`VALUES`  
(now()), `INTERVAL (time)`