sql DATE = GETDATE() 1

sql DATE = GETDATE()

CAST(GETDATE() AS DATE)

Here is what the above code is Doing:
1. We’re creating a variable called `query` that contains the SQL query we want to run.
2. We’re using the `.execute()` method to run the query.
3. We’re using the `.fetchall()` method to get all the results from the query.
4. We’re using the `.read_sql()` method to read the results of the query into a pandas dataframe.
5. We’re using the `.head()` method to print out the first 5 rows of the dataframe.

Let’s run the code and see what happens.

**Exercise**

sql DATE = GETDATE() 2

– Run the code in the cell above.

**Answer**

> “`python
> # Run the code in the cell above.
> “`

**Expected output**

> sql DATE = GETDATE() 3

### 2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.2.

Similar Posts