Write the Python code for creating a table based on the following SQL statement: CREATE TABLE phone
Fantastic news! We've Found the answer you've been seeking!
Question:
- Write the Python code for creating a table based on the following SQL statement:
- CREATE TABLE phone (
- phone_id INT,
- country_code INT NOT NULL,
- phone_number INT NOT NULL,
- phone_type VARCHAR(12),
- PRIMARY KEY(phone_id)
- );
- Write the Python code to select rows from the table based on the following SQL statement:
- SELECT phone_number
- FROM phone
- WHERE country_code = 'US'
- Write the Python code to update rows in the table based on the following SQL statement:
- UPDATE phone
- SET phone_type = 'MOBILE
- WHERE phone_type = 'CELLULAR'
- Write the Python code to delete rows in the table based on the following SQL statement:
- DELETE FROM phone
- WHERE country_code = 'XX'
- Write the Python code to drop the table based on the following SQL statement:
- DROP TABLE phone
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: