For the video streaming service system….
Open the attached Python Script in IDLE (This is the Python IDEthat was installed when you
downloaded and installed Python in step 1).
1.. In the line of code that starts as:
conn = pyodbc.conn(…
change the Server and Database options to match your server nameand database name. You
can find the server name by opening Microsoft SQL ServerManagement Studio, and copying the
server name that is displayed to you. For the Database option,you should write the name of
your database. IT shall appear in the Databases tab on the leftside of Microsoft SQL Server
Management Studio.
2. Change the table name in the third line of the code:
cursor.execute(‘SELECT * FROM Pizza’)
use the name of a table from your database.
3. Press F5 to run the script. This should establish aconnection with your database, select all the
rows in the specified table, and print all rows to the IDLEconsole.
4. Modify the script so that it selects all rows from all yourtables, and prints the results to IDLE
console.
5. Modify the script so that it executes an insert query in oneof your database tables. Print the
table before and after you execute this query in order to ensurethe new information was
inserted into the table.
Lab Submission
Insert your modified code along with a screen shot of yourscript, and screen shots of the output results
in ONE word document.
db_connect.py:
import pyodbc
conn = pyodbc.connect(“Driver={ODBC Driver 17 for SQLServer};”
“Server=EN4114880SQL_MAIN;”
“Database=Pizza_System;”
“Trusted_Connection=yes;”)
cursor = conn.cursor()
cursor.execute(‘SELECT * FROM Pizza’)
for row in cursor:
print(‘row = %r’ % (row,))
Expert Answer
Answer to For the video streaming service system…. Open the attached Python Script in IDLE (This is the Python IDE that was inst…